Make a generic booster pack giver
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.Airplane.Data;
|
||||
|
||||
namespace Minigames.Airplane.Abilities
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.Airplane.Abilities;
|
||||
using Minigames.Airplane.Data;
|
||||
using UnityEngine;
|
||||
@@ -81,7 +82,7 @@ namespace Minigames.Airplane.Core
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Load settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
|
||||
if (settings != null)
|
||||
{
|
||||
mass = settings.AirplaneMass;
|
||||
@@ -231,7 +232,7 @@ namespace Minigames.Airplane.Core
|
||||
}
|
||||
|
||||
// Check if it's ground (by layer)
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
|
||||
if (settings != null && other.gameObject.layer == settings.GroundLayer)
|
||||
{
|
||||
if (showDebugLogs) Logging.Debug($"[AirplaneController] Hit ground at Y={transform.position.y:F2}");
|
||||
@@ -302,7 +303,7 @@ namespace Minigames.Airplane.Core
|
||||
public void Initialize(AirplaneAbilityType abilityType)
|
||||
{
|
||||
// Get settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
|
||||
if (settings == null)
|
||||
{
|
||||
Logging.Error("[AirplaneController] Cannot initialize - settings not found!");
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.Airplane.Data;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -261,7 +262,7 @@ namespace Minigames.Airplane.Core
|
||||
Logging.Warning("[AirplaneGameManager] Using default airplane type from settings as fallback.");
|
||||
|
||||
// Fallback: use default type from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
|
||||
if (settings != null)
|
||||
{
|
||||
_selectedAirplaneType = settings.DefaultAirplaneType;
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using AppleHills.Core.Settings;
|
||||
using Common.Input;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.Airplane.Data;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -142,7 +143,7 @@ namespace Minigames.Airplane.Core
|
||||
}
|
||||
|
||||
// Get settings and airplane config
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
|
||||
if (settings == null)
|
||||
{
|
||||
Logging.Error("[AirplaneLaunchController] Cannot spawn - settings not found!");
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.Airplane.Data;
|
||||
using Minigames.Airplane.UI;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using Common.Input;
|
||||
using Core.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.Airplane.Settings
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.Airplane.Data;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -233,7 +234,7 @@ namespace Minigames.Airplane.UI
|
||||
private void PopulateButtonIcons()
|
||||
{
|
||||
// Get airplane settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IAirplaneSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IAirplaneSettings>();
|
||||
if (settings == null)
|
||||
{
|
||||
if (showDebugLogs)
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AppleHills.Core.Interfaces;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using AppleHills.Core.Interfaces;
|
||||
using AppleHills.Core.Settings;
|
||||
using Cinematics;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
@@ -8,10 +7,10 @@ using Minigames.DivingForPictures.PictureCamera;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Core.Settings;
|
||||
using Minigames.DivingForPictures.Bubbles;
|
||||
using UI.Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.Playables;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
@@ -664,40 +663,64 @@ namespace Minigames.DivingForPictures
|
||||
|
||||
_activeMonsters.Clear();
|
||||
|
||||
// 1) Call the booster pack giver if available
|
||||
bool completed = false;
|
||||
var giver = UI.CardSystem.MinigameBoosterGiver.Instance;
|
||||
if (giver != null)
|
||||
{
|
||||
UIPageController.Instance.ShowAllUI();
|
||||
Logging.Debug("[DivingGameManager] Starting booster giver sequence");
|
||||
giver.GiveBooster(() =>
|
||||
{
|
||||
completed = true;
|
||||
Logging.Debug("[DivingGameManager] Booster giver completed callback received");
|
||||
});
|
||||
// Calculate booster pack reward based on pictures taken
|
||||
int boosterPackCount = CalculateBoosterPackReward();
|
||||
Logging.Debug($"[DivingGameManager] Pictures taken: {picturesTaken}, awarding {boosterPackCount} booster pack(s)");
|
||||
|
||||
// 2) Wait for it to finish (NO timeout - wait indefinitely for user interaction)
|
||||
while (!completed)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
Logging.Debug("[DivingGameManager] Booster giver sequence finished, proceeding to game over");
|
||||
// Show UI and grant booster packs using new async method
|
||||
UIPageController.Instance.ShowAllUI();
|
||||
Logging.Debug("[DivingGameManager] Starting booster giver sequence via GameManager");
|
||||
|
||||
// Use the new GameManager method to handle the booster pack reward
|
||||
var task = GameManager.Instance.GiveBoosterPacksAsync(boosterPackCount);
|
||||
|
||||
// Wait for the task to complete
|
||||
while (!task.IsCompleted)
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
|
||||
// Check for exceptions
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
Logging.Warning($"[DivingGameManager] Booster pack reward failed: {task.Exception?.GetBaseException().Message}");
|
||||
}
|
||||
else
|
||||
{
|
||||
// If no giver is present, proceed immediately
|
||||
Logging.Debug("[DivingGameManager] MinigameBoosterGiver not found; skipping booster animation.");
|
||||
Logging.Debug("[DivingGameManager] Booster giver sequence finished, proceeding to game over");
|
||||
}
|
||||
|
||||
// 3) Only then show the game over screen
|
||||
// Show the game over screen
|
||||
CinematicsManager.Instance.ShowGameOverScreen();
|
||||
|
||||
// Final score could be saved to player prefs or other persistence
|
||||
Logging.Debug($"Final Score: {_playerScore}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calculates how many booster packs to award based on the number of pictures taken.
|
||||
/// </summary>
|
||||
/// <returns>Number of booster packs to award</returns>
|
||||
private int CalculateBoosterPackReward()
|
||||
{
|
||||
if (picturesTaken <= 3)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (picturesTaken <= 5)
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
else if (picturesTaken <= 10)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts a smooth transition to the new velocity factor
|
||||
/// </summary>
|
||||
|
||||
@@ -5,6 +5,7 @@ using Pooling;
|
||||
using Utils;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ using Pooling;
|
||||
using AppleHills.Core.Settings;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using UnityEngine.Audio;
|
||||
|
||||
namespace Minigames.DivingForPictures.PictureCamera
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using AppleHills.Utilities;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.DivingForPictures.Player;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using AppleHillsCamera;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Input;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ using AppleHills.Core.Settings;
|
||||
using Utils;
|
||||
using AppleHills.Core.Interfaces;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace Minigames.DivingForPictures
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Core;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Fort;
|
||||
@@ -41,7 +42,7 @@ namespace Minigames.FortFight.AI
|
||||
private ProjectileType _selectedAmmo;
|
||||
|
||||
// Settings cache
|
||||
private AppleHills.Core.Settings.IFortFightSettings _cachedSettings;
|
||||
private IFortFightSettings _cachedSettings;
|
||||
private AppleHills.Core.Settings.FortFightDeveloperSettings _cachedDevSettings;
|
||||
private AIDifficultyData _currentDifficultyData;
|
||||
|
||||
@@ -55,7 +56,7 @@ namespace Minigames.FortFight.AI
|
||||
public void Initialize()
|
||||
{
|
||||
// Load settings
|
||||
_cachedSettings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
_cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
_cachedDevSettings = GameManager.GetDeveloperSettings<AppleHills.Core.Settings.FortFightDeveloperSettings>();
|
||||
|
||||
if (_cachedSettings == null)
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Data;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Linq;
|
||||
using AppleHills.Core.Settings;
|
||||
using Common.Input;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Projectiles;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using AppleHills.Core.Settings;
|
||||
using Common.Input;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Data;
|
||||
using Minigames.FortFight.Projectiles;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Data;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -178,7 +179,7 @@ namespace Minigames.FortFight.Core
|
||||
{
|
||||
transitionTimer += Time.deltaTime;
|
||||
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
float transitionDelay = settings?.TurnTransitionDelay ?? 1.5f;
|
||||
|
||||
if (transitionTimer >= transitionDelay)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using UnityEngine;
|
||||
using Minigames.FortFight.Data;
|
||||
|
||||
@@ -70,14 +71,14 @@ namespace Minigames.FortFight.Fort
|
||||
private bool isDestroyed = false;
|
||||
|
||||
// Cached settings
|
||||
private AppleHills.Core.Settings.IFortFightSettings _cachedSettings;
|
||||
private AppleHills.Core.Settings.IFortFightSettings CachedSettings
|
||||
private IFortFightSettings _cachedSettings;
|
||||
private IFortFightSettings CachedSettings
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cachedSettings == null)
|
||||
{
|
||||
_cachedSettings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
_cachedSettings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
}
|
||||
return _cachedSettings;
|
||||
}
|
||||
@@ -210,7 +211,7 @@ namespace Minigames.FortFight.Fort
|
||||
{
|
||||
if (spriteRenderer == null) return;
|
||||
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
Color targetColor = settings?.DamageColorTint ?? new Color(0.5f, 0.5f, 0.5f);
|
||||
|
||||
// Darken sprite based on damage
|
||||
|
||||
@@ -5,6 +5,7 @@ using Core;
|
||||
using Core.Lifecycle;
|
||||
using UnityEngine;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core.Settings;
|
||||
|
||||
namespace Minigames.FortFight.Fort
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Projectiles
|
||||
@@ -34,7 +35,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
private IEnumerator ActivationDelayCoroutine()
|
||||
{
|
||||
// Get activation delay from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
float activationDelay = settings?.CeilingFanActivationDelay ?? 0.5f;
|
||||
|
||||
// Wait for delay
|
||||
@@ -82,7 +83,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
}
|
||||
|
||||
// Get drop configuration from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
float dropDelay = settings?.CeilingFanDropDelay ?? 0.2f;
|
||||
float dropSpeed = settings?.CeilingFanDropSpeed ?? 20f;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Fort;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -83,7 +84,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
ProjectileType = projectileType;
|
||||
|
||||
// Load damage and mass from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
if (settings != null)
|
||||
{
|
||||
var config = settings.GetProjectileConfig(projectileType);
|
||||
@@ -120,7 +121,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
base.OnManagedAwake();
|
||||
|
||||
// Automatically assign projectile to correct layer from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
if (settings != null && settings.ProjectileLayer >= 0 && gameObject.layer != settings.ProjectileLayer)
|
||||
{
|
||||
gameObject.layer = settings.ProjectileLayer;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Projectiles
|
||||
@@ -24,7 +25,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
}
|
||||
|
||||
// Get settings for trash pieces
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
int pieceCount = settings?.TrashBagPieceCount ?? 8;
|
||||
|
||||
Logging.Debug($"[TrashBagProjectile] Splitting into {pieceCount} pieces");
|
||||
@@ -53,7 +54,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
}
|
||||
|
||||
// Get settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
int pieceCount = settings?.TrashBagPieceCount ?? 8;
|
||||
float pieceForce = settings?.TrashBagPieceForce ?? 10f;
|
||||
float spreadAngle = settings?.TrashBagSpreadAngle ?? 60f;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Projectiles
|
||||
@@ -19,7 +20,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
private void Start()
|
||||
{
|
||||
// Get configuration from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
damage = settings?.TrashPieceDamage ?? 5f;
|
||||
float lifetime = settings?.TrashPieceLifetime ?? 5f;
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.FortFight.Projectiles
|
||||
@@ -26,7 +27,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
SpawnImpactEffect(collision.contacts[0].point);
|
||||
|
||||
// Get damage from settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
float blockDamage = settings?.VacuumBlockDamage ?? 999f;
|
||||
|
||||
// Deal high damage to destroy block instantly
|
||||
@@ -62,7 +63,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
isSliding = true;
|
||||
|
||||
// Get settings
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
if (settings != null)
|
||||
{
|
||||
maxBlocksToDestroy = settings.VacuumDestroyBlockCount;
|
||||
@@ -85,7 +86,7 @@ namespace Minigames.FortFight.Projectiles
|
||||
if (isSliding && rb2D != null)
|
||||
{
|
||||
// Set constant velocity in slide direction
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
float slideSpeed = settings?.VacuumSlideSpeed ?? 10f;
|
||||
|
||||
rb2D.linearVelocity = slideDirection * slideSpeed;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.FortFight.Core;
|
||||
using Minigames.FortFight.Data;
|
||||
using UnityEngine;
|
||||
@@ -97,7 +98,7 @@ namespace Minigames.FortFight.UI
|
||||
|
||||
// Get available projectile types from settings
|
||||
var availableTypes = AmmunitionManager.Instance.GetAvailableProjectileTypes();
|
||||
var settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IFortFightSettings>();
|
||||
var settings = GameManager.GetSettingsObject<IFortFightSettings>();
|
||||
|
||||
if (settings == null)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Core;
|
||||
using Core.Lifecycle;
|
||||
using Core.Settings;
|
||||
using Minigames.StatueDressup.Data;
|
||||
using UnityEngine;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
@@ -18,7 +19,7 @@ namespace Minigames.StatueDressup.Controllers
|
||||
|
||||
// Static callback queue for when instance doesn't exist yet
|
||||
private static readonly List<System.Action> PendingCallbacks = new List<System.Action>();
|
||||
private AppleHills.Core.Settings.IStatueDressupSettings settings;
|
||||
private IStatueDressupSettings settings;
|
||||
private Dictionary<string, DecorationData> decorationDataDict;
|
||||
private AsyncOperationHandle<System.Collections.Generic.IList<DecorationData>> decorationDataHandle;
|
||||
private bool isLoaded;
|
||||
@@ -26,7 +27,7 @@ namespace Minigames.StatueDressup.Controllers
|
||||
/// <summary>
|
||||
/// Get the settings instance
|
||||
/// </summary>
|
||||
public AppleHills.Core.Settings.IStatueDressupSettings Settings => settings;
|
||||
public IStatueDressupSettings Settings => settings;
|
||||
|
||||
/// <summary>
|
||||
/// Check if data is loaded and ready (implements IReadyNotifier)
|
||||
@@ -102,7 +103,7 @@ namespace Minigames.StatueDressup.Controllers
|
||||
Logging.Debug("[DecorationDataManager] Waiting for GameManager to be accessible...");
|
||||
|
||||
// Wait until GameManager is accessible and settings can be retrieved
|
||||
settings = GameManager.GetSettingsObject<AppleHills.Core.Settings.IStatueDressupSettings>();
|
||||
settings = GameManager.GetSettingsObject<IStatueDressupSettings>();
|
||||
|
||||
Logging.Debug("[DecorationDataManager] Settings loaded successfully");
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Minigames.StatueDressup.Data;
|
||||
using Core.Settings;
|
||||
using Minigames.StatueDressup.Data;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Minigames.StatueDressup.DragDrop
|
||||
@@ -37,7 +38,7 @@ namespace Minigames.StatueDressup.DragDrop
|
||||
/// <summary>
|
||||
/// Settings for the minigame
|
||||
/// </summary>
|
||||
public AppleHills.Core.Settings.IStatueDressupSettings Settings { get; set; }
|
||||
public IStatueDressupSettings Settings { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Callback when drag operation finishes (success or failure)
|
||||
@@ -67,7 +68,7 @@ namespace Minigames.StatueDressup.DragDrop
|
||||
RectTransform statueOutline,
|
||||
Transform statueParent,
|
||||
Controllers.StatueDecorationController controller,
|
||||
AppleHills.Core.Settings.IStatueDressupSettings settings,
|
||||
IStatueDressupSettings settings,
|
||||
System.Action onFinished,
|
||||
System.Action onShowOutline,
|
||||
System.Action onHideOutline)
|
||||
@@ -92,7 +93,7 @@ namespace Minigames.StatueDressup.DragDrop
|
||||
public static DecorationDragContext CreateForPlaced(
|
||||
DecorationData data,
|
||||
Controllers.StatueDecorationController controller,
|
||||
AppleHills.Core.Settings.IStatueDressupSettings settings,
|
||||
IStatueDressupSettings settings,
|
||||
RectTransform statueOutline = null,
|
||||
Transform canvasParent = null,
|
||||
System.Action onShowOutline = null,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.StatueDressup.Controllers;
|
||||
using Minigames.StatueDressup.Data;
|
||||
using Minigames.StatueDressup.Events;
|
||||
@@ -28,7 +29,7 @@ namespace Minigames.StatueDressup.DragDrop
|
||||
private RectTransform _statueOutline;
|
||||
private Transform _statueParent;
|
||||
private StatueDecorationController _controller;
|
||||
private AppleHills.Core.Settings.IStatueDressupSettings _settings;
|
||||
private IStatueDressupSettings _settings;
|
||||
private System.Action _onFinishedCallback;
|
||||
private System.Action _onShowOutlineCallback;
|
||||
private System.Action _onHideOutlineCallback;
|
||||
@@ -123,7 +124,7 @@ namespace Minigames.StatueDressup.DragDrop
|
||||
/// </summary>
|
||||
[System.Obsolete("Use InitializeWithContext instead")]
|
||||
public void Initialize(DecorationData data, RectTransform pStatueOutline, Transform pStatueParent,
|
||||
StatueDecorationController pController, AppleHills.Core.Settings.IStatueDressupSettings pSettings,
|
||||
StatueDecorationController pController, IStatueDressupSettings pSettings,
|
||||
System.Action pOnFinishedCallback, System.Action onShowOutline = null, System.Action onHideOutline = null)
|
||||
{
|
||||
var context = DecorationDragContext.CreateForNewDrag(
|
||||
@@ -138,7 +139,7 @@ namespace Minigames.StatueDressup.DragDrop
|
||||
/// </summary>
|
||||
[System.Obsolete("Use InitializeWithContext instead")]
|
||||
public void InitializeAsPlaced(DecorationData data, StatueDecorationController pController,
|
||||
AppleHills.Core.Settings.IStatueDressupSettings pSettings, RectTransform pStatueOutline = null,
|
||||
IStatueDressupSettings pSettings, RectTransform pStatueOutline = null,
|
||||
Transform pCanvasParent = null, System.Action onShowOutline = null, System.Action onHideOutline = null,
|
||||
System.Action onFinished = null)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Core;
|
||||
using Core.Settings;
|
||||
using Minigames.StatueDressup.Controllers;
|
||||
using Minigames.StatueDressup.DragDrop;
|
||||
using UnityEngine;
|
||||
@@ -24,7 +25,7 @@ namespace Minigames.StatueDressup.UI
|
||||
[SerializeField] private int activeDecorationSortOrder = 100;
|
||||
|
||||
private DecorationDraggableInstance _targetDecoration;
|
||||
private AppleHills.Core.Settings.IStatueDressupSettings _settings;
|
||||
private IStatueDressupSettings _settings;
|
||||
private bool _isInitialized;
|
||||
|
||||
// Canvas management for rendering order
|
||||
|
||||
@@ -2,6 +2,7 @@ using Core;
|
||||
using UnityEngine;
|
||||
using Input;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core.Settings;
|
||||
|
||||
namespace Minigames.TrashMaze.Core
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using Minigames.TrashMaze.Core;
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using AppleHills.Core.Settings;
|
||||
using Core.Settings;
|
||||
|
||||
namespace Minigames.TrashMaze.Objects
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user