Update methods to be internal, remove invocation bloat
This commit is contained in:
@@ -56,7 +56,7 @@ public class BirdEyesBehavior : ManagedBehaviour
|
|||||||
_statemachine.ChangeState("BirdSpawned");
|
_statemachine.ChangeState("BirdSpawned");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
base.OnSceneRestoreRequested(serializedData);
|
base.OnSceneRestoreRequested(serializedData);
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ public class BirdEyesBehavior : ManagedBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
return _wolterisoutTriggered.ToString();
|
return _wolterisoutTriggered.ToString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace Bootstrap
|
|||||||
// Run very early - need to set up loading screen before other systems initialize
|
// Run very early - need to set up loading screen before other systems initialize
|
||||||
public override int ManagedAwakePriority => 5;
|
public override int ManagedAwakePriority => 5;
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
LogDebugMessage("BootSceneController.Awake() - Initializing loading screen DURING bootstrap");
|
LogDebugMessage("BootSceneController.Awake() - Initializing loading screen DURING bootstrap");
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ namespace Bootstrap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
LogDebugMessage("BootSceneController.OnManagedStart() - Boot is GUARANTEED complete, starting scene loading");
|
LogDebugMessage("BootSceneController.OnManagedStart() - Boot is GUARANTEED complete, starting scene loading");
|
||||||
|
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ namespace Cinematics
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 170; // Cinematic systems
|
public override int ManagedAwakePriority => 170; // Cinematic systems
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
Logging.Debug("[CinematicsManager] Initialized");
|
Logging.Debug("[CinematicsManager] Initialized");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Cinematics
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 180; // Cinematic UI
|
public override int ManagedAwakePriority => 180; // Cinematic UI
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Reset the progress bar
|
// Reset the progress bar
|
||||||
if (radialProgressBar != null)
|
if (radialProgressBar != null)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Core
|
|||||||
// ManagedBehaviour configuration
|
// ManagedBehaviour configuration
|
||||||
public override int ManagedAwakePriority => 10; // Core infrastructure - runs early
|
public override int ManagedAwakePriority => 10; // Core infrastructure - runs early
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -55,7 +55,7 @@ namespace Core
|
|||||||
_managerLogVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().gameManagerLogVerbosity;
|
_managerLogVerbosity = DeveloperSettingsProvider.Instance.GetSettings<DebugSettings>().gameManagerLogVerbosity;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Settings are already initialized in OnManagedAwake()
|
// Settings are already initialized in OnManagedAwake()
|
||||||
// This is available for future initialization that depends on other managers
|
// This is available for future initialization that depends on other managers
|
||||||
|
|||||||
@@ -50,18 +50,18 @@ namespace Core
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 75; // Item registry
|
public override int ManagedAwakePriority => 75; // Item registry
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
Logging.Debug("[ItemManager] Initialized");
|
Logging.Debug("[ItemManager] Initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneReady()
|
internal override void OnSceneReady()
|
||||||
{
|
{
|
||||||
// Replaces SceneLoadStarted subscription for clearing registrations
|
// Replaces SceneLoadStarted subscription for clearing registrations
|
||||||
ClearAllRegistrations();
|
ClearAllRegistrations();
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace Core.Lifecycle
|
|||||||
// Call OnManagedAwake immediately after registration (early initialization hook)
|
// Call OnManagedAwake immediately after registration (early initialization hook)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeManagedAwake();
|
component.OnManagedAwake();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -157,7 +157,7 @@ namespace Core.Lifecycle
|
|||||||
LogDebug($"Late registration: Calling OnManagedStart immediately for {component.gameObject.name}");
|
LogDebug($"Late registration: Calling OnManagedStart immediately for {component.gameObject.name}");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeManagedStart();
|
component.OnManagedStart();
|
||||||
HandleAutoRegistrations(component);
|
HandleAutoRegistrations(component);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -174,7 +174,7 @@ namespace Core.Lifecycle
|
|||||||
LogDebug($"Late registration: Calling OnSceneReady immediately for {component.gameObject.name}");
|
LogDebug($"Late registration: Calling OnSceneReady immediately for {component.gameObject.name}");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeSceneReady();
|
component.OnSceneReady();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -240,7 +240,7 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeManagedStart();
|
component.OnManagedStart();
|
||||||
HandleAutoRegistrations(component);
|
HandleAutoRegistrations(component);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -292,7 +292,7 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeManagedStart();
|
component.OnManagedStart();
|
||||||
HandleAutoRegistrations(component);
|
HandleAutoRegistrations(component);
|
||||||
LogDebug($"Processed batched component: {component.gameObject.name} (Priority: {component.ManagedAwakePriority})");
|
LogDebug($"Processed batched component: {component.gameObject.name} (Priority: {component.ManagedAwakePriority})");
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ namespace Core.Lifecycle
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeSceneUnloading();
|
component.OnSceneUnloading();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -361,7 +361,7 @@ namespace Core.Lifecycle
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeSceneReady();
|
component.OnSceneReady();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -389,7 +389,7 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string serializedData = component.InvokeSceneSaveRequested();
|
string serializedData = component.OnSceneSaveRequested();
|
||||||
if (!string.IsNullOrEmpty(serializedData))
|
if (!string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
string saveId = component.SaveId;
|
string saveId = component.SaveId;
|
||||||
@@ -425,7 +425,7 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string serializedData = component.InvokeGlobalSaveRequested();
|
string serializedData = component.OnGlobalSaveRequested();
|
||||||
if (!string.IsNullOrEmpty(serializedData))
|
if (!string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
saveData[component.SaveId] = serializedData;
|
saveData[component.SaveId] = serializedData;
|
||||||
@@ -465,7 +465,7 @@ namespace Core.Lifecycle
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeSceneRestoreRequested(serializedData);
|
component.OnSceneRestoreRequested(serializedData);
|
||||||
restoredCount++;
|
restoredCount++;
|
||||||
LogDebug($"Restored scene data to: {component.SaveId}");
|
LogDebug($"Restored scene data to: {component.SaveId}");
|
||||||
}
|
}
|
||||||
@@ -496,7 +496,7 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeSceneRestoreCompleted();
|
component.OnSceneRestoreCompleted();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -529,7 +529,7 @@ namespace Core.Lifecycle
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeGlobalRestoreRequested(serializedData);
|
component.OnGlobalRestoreRequested(serializedData);
|
||||||
restoredCount++;
|
restoredCount++;
|
||||||
LogDebug($"Restored global data to: {component.SaveId}");
|
LogDebug($"Restored global data to: {component.SaveId}");
|
||||||
}
|
}
|
||||||
@@ -561,7 +561,7 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeGlobalLoadCompleted();
|
component.OnGlobalLoadCompleted();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -588,7 +588,7 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
component.InvokeGlobalSaveStarted();
|
component.OnGlobalSaveStarted();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -80,24 +80,6 @@ namespace Core.Lifecycle
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public Accessors (for LifecycleManager)
|
|
||||||
|
|
||||||
// Public wrappers to invoke protected lifecycle methods
|
|
||||||
public void InvokeManagedAwake() => OnManagedAwake();
|
|
||||||
public void InvokeManagedStart() => OnManagedStart();
|
|
||||||
public void InvokeSceneUnloading() => OnSceneUnloading();
|
|
||||||
public void InvokeSceneReady() => OnSceneReady();
|
|
||||||
public string InvokeSceneSaveRequested() => OnSceneSaveRequested();
|
|
||||||
public void InvokeSceneRestoreRequested(string data) => OnSceneRestoreRequested(data);
|
|
||||||
public void InvokeSceneRestoreCompleted() => OnSceneRestoreCompleted();
|
|
||||||
public string InvokeGlobalSaveRequested() => OnGlobalSaveRequested();
|
|
||||||
public void InvokeGlobalRestoreRequested(string data) => OnGlobalRestoreRequested(data);
|
|
||||||
public void InvokeManagedDestroy() => OnManagedDestroy();
|
|
||||||
public void InvokeGlobalLoadCompleted() => OnGlobalLoadCompleted();
|
|
||||||
public void InvokeGlobalSaveStarted() => OnGlobalSaveStarted();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
|
|
||||||
private bool _isRegistered;
|
private bool _isRegistered;
|
||||||
@@ -157,8 +139,9 @@ namespace Core.Lifecycle
|
|||||||
/// Use for early initialization such as setting singleton instances.
|
/// Use for early initialization such as setting singleton instances.
|
||||||
/// TIMING: Fires during component's Awake(), no execution order guarantees between components.
|
/// TIMING: Fires during component's Awake(), no execution order guarantees between components.
|
||||||
/// NOT priority-ordered - fires whenever Unity calls this component's Awake().
|
/// NOT priority-ordered - fires whenever Unity calls this component's Awake().
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnManagedAwake()
|
internal virtual void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Override in derived classes
|
// Override in derived classes
|
||||||
}
|
}
|
||||||
@@ -169,8 +152,9 @@ namespace Core.Lifecycle
|
|||||||
/// For boot-time components: Called during LifecycleManager.BroadcastManagedStart (priority ordered).
|
/// For boot-time components: Called during LifecycleManager.BroadcastManagedStart (priority ordered).
|
||||||
/// For late-registered components: Called immediately upon registration (bootstrap already complete).
|
/// For late-registered components: Called immediately upon registration (bootstrap already complete).
|
||||||
/// Use for initialization that depends on other systems.
|
/// Use for initialization that depends on other systems.
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnManagedStart()
|
internal virtual void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Override in derived classes
|
// Override in derived classes
|
||||||
}
|
}
|
||||||
@@ -179,8 +163,9 @@ namespace Core.Lifecycle
|
|||||||
/// Called before the scene this component belongs to is unloaded.
|
/// Called before the scene this component belongs to is unloaded.
|
||||||
/// Called in REVERSE priority order (higher values execute first).
|
/// Called in REVERSE priority order (higher values execute first).
|
||||||
/// Use for scene-specific cleanup.
|
/// Use for scene-specific cleanup.
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnSceneUnloading()
|
internal virtual void OnSceneUnloading()
|
||||||
{
|
{
|
||||||
// Override in derived classes
|
// Override in derived classes
|
||||||
}
|
}
|
||||||
@@ -189,8 +174,9 @@ namespace Core.Lifecycle
|
|||||||
/// Called after the scene this component belongs to has finished loading.
|
/// Called after the scene this component belongs to has finished loading.
|
||||||
/// Called in priority order (lower values execute first).
|
/// Called in priority order (lower values execute first).
|
||||||
/// Use for scene-specific initialization.
|
/// Use for scene-specific initialization.
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnSceneReady()
|
internal virtual void OnSceneReady()
|
||||||
{
|
{
|
||||||
// Override in derived classes
|
// Override in derived classes
|
||||||
}
|
}
|
||||||
@@ -204,8 +190,10 @@ namespace Core.Lifecycle
|
|||||||
/// - Called BEFORE scene unload during scene transitions
|
/// - Called BEFORE scene unload during scene transitions
|
||||||
/// - Frequency: Every scene transition
|
/// - Frequency: Every scene transition
|
||||||
/// - Use for: Level progress, object positions, puzzle states
|
/// - Use for: Level progress, object positions, puzzle states
|
||||||
|
///
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual string OnSceneSaveRequested()
|
internal virtual string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
return null; // Default: no data to save
|
return null; // Default: no data to save
|
||||||
}
|
}
|
||||||
@@ -222,8 +210,10 @@ namespace Core.Lifecycle
|
|||||||
/// - Called AFTER scene load, during OnSceneReady phase
|
/// - Called AFTER scene load, during OnSceneReady phase
|
||||||
/// - Frequency: Every scene transition
|
/// - Frequency: Every scene transition
|
||||||
/// - Use for: Restoring level progress, object positions, puzzle states
|
/// - Use for: Restoring level progress, object positions, puzzle states
|
||||||
|
///
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnSceneRestoreRequested(string serializedData)
|
internal virtual void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
// Default: no-op
|
// Default: no-op
|
||||||
}
|
}
|
||||||
@@ -245,8 +235,10 @@ namespace Core.Lifecycle
|
|||||||
/// COMMON PATTERN:
|
/// COMMON PATTERN:
|
||||||
/// Use this to perform actions that depend on whether data was restored or not.
|
/// Use this to perform actions that depend on whether data was restored or not.
|
||||||
/// Example: Play one-time audio only if it hasn't been played before (_hasPlayed == false).
|
/// Example: Play one-time audio only if it hasn't been played before (_hasPlayed == false).
|
||||||
|
///
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnSceneRestoreCompleted()
|
internal virtual void OnSceneRestoreCompleted()
|
||||||
{
|
{
|
||||||
// Default: no-op
|
// Default: no-op
|
||||||
}
|
}
|
||||||
@@ -259,8 +251,10 @@ namespace Core.Lifecycle
|
|||||||
/// - Called ONCE on game boot after save file is read
|
/// - Called ONCE on game boot after save file is read
|
||||||
/// - NOT called during scene transitions
|
/// - NOT called during scene transitions
|
||||||
/// - Use for: Player inventory, unlocked features, card collections
|
/// - Use for: Player inventory, unlocked features, card collections
|
||||||
|
///
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnGlobalRestoreRequested(string serializedData)
|
internal virtual void OnGlobalRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
// Default: no-op
|
// Default: no-op
|
||||||
}
|
}
|
||||||
@@ -274,8 +268,10 @@ namespace Core.Lifecycle
|
|||||||
/// - Called ONCE before save file is written (on quit, manual save, etc.)
|
/// - Called ONCE before save file is written (on quit, manual save, etc.)
|
||||||
/// - NOT called during scene transitions
|
/// - NOT called during scene transitions
|
||||||
/// - Use for: Player inventory, unlocked features, card collections
|
/// - Use for: Player inventory, unlocked features, card collections
|
||||||
|
///
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual string OnGlobalSaveRequested()
|
internal virtual string OnGlobalSaveRequested()
|
||||||
{
|
{
|
||||||
return null; // Default: no data to save
|
return null; // Default: no data to save
|
||||||
}
|
}
|
||||||
@@ -289,8 +285,10 @@ namespace Core.Lifecycle
|
|||||||
/// - Called ONCE on game boot after all restore operations complete
|
/// - Called ONCE on game boot after all restore operations complete
|
||||||
/// - NOT called during scene transitions
|
/// - NOT called during scene transitions
|
||||||
/// - Use for: Triggering UI updates, broadcasting load events
|
/// - Use for: Triggering UI updates, broadcasting load events
|
||||||
|
///
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnGlobalLoadCompleted()
|
internal virtual void OnGlobalLoadCompleted()
|
||||||
{
|
{
|
||||||
// Default: no-op
|
// Default: no-op
|
||||||
}
|
}
|
||||||
@@ -304,8 +302,10 @@ namespace Core.Lifecycle
|
|||||||
/// - Called ONCE before save file is written
|
/// - Called ONCE before save file is written
|
||||||
/// - NOT called during scene transitions
|
/// - NOT called during scene transitions
|
||||||
/// - Use for: Final validation, cleanup operations
|
/// - Use for: Final validation, cleanup operations
|
||||||
|
///
|
||||||
|
/// NOTE: Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnGlobalSaveStarted()
|
internal virtual void OnGlobalSaveStarted()
|
||||||
{
|
{
|
||||||
// Default: no-op
|
// Default: no-op
|
||||||
}
|
}
|
||||||
@@ -315,8 +315,9 @@ namespace Core.Lifecycle
|
|||||||
/// Called in REVERSE priority order (higher values execute first).
|
/// Called in REVERSE priority order (higher values execute first).
|
||||||
/// NOTE: Most cleanup is automatic (managed events, auto-registrations).
|
/// NOTE: Most cleanup is automatic (managed events, auto-registrations).
|
||||||
/// Only override if you need custom cleanup logic.
|
/// Only override if you need custom cleanup logic.
|
||||||
|
/// Internal visibility allows LifecycleManager to call directly. Override in derived classes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected virtual void OnManagedDestroy()
|
internal virtual void OnManagedDestroy()
|
||||||
{
|
{
|
||||||
// Override in derived classes
|
// Override in derived classes
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,18 +129,18 @@ namespace AppleHills.Core
|
|||||||
|
|
||||||
#region Lifecycle Methods
|
#region Lifecycle Methods
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// QuickAccess has minimal initialization
|
// QuickAccess has minimal initialization
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneUnloading()
|
internal override void OnSceneUnloading()
|
||||||
{
|
{
|
||||||
// Clear references BEFORE scene unloads for better cleanup timing
|
// Clear references BEFORE scene unloads for better cleanup timing
|
||||||
ClearReferences();
|
ClearReferences();
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ namespace Core.SaveLoad
|
|||||||
// ManagedBehaviour configuration
|
// ManagedBehaviour configuration
|
||||||
public override int ManagedAwakePriority => 20; // After GameManager and SceneManagerService
|
public override int ManagedAwakePriority => 20; // After GameManager and SceneManagerService
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -56,7 +56,7 @@ namespace Core.SaveLoad
|
|||||||
IsRestoringState = false;
|
IsRestoringState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
Logging.Debug("[SaveLoadManager] Initialized");
|
Logging.Debug("[SaveLoadManager] Initialized");
|
||||||
|
|
||||||
@@ -67,19 +67,19 @@ namespace Core.SaveLoad
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneReady()
|
internal override void OnSceneReady()
|
||||||
{
|
{
|
||||||
// SaveableInteractables now auto-register via ManagedBehaviour lifecycle
|
// SaveableInteractables now auto-register via ManagedBehaviour lifecycle
|
||||||
// No need to discover and register them manually
|
// No need to discover and register them manually
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
// SaveLoadManager orchestrates saves, doesn't participate in them
|
// SaveLoadManager orchestrates saves, doesn't participate in them
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string OnGlobalSaveRequested()
|
internal override string OnGlobalSaveRequested()
|
||||||
{
|
{
|
||||||
// SaveLoadManager orchestrates saves, doesn't participate in them
|
// SaveLoadManager orchestrates saves, doesn't participate in them
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ namespace Core
|
|||||||
// Enable save/load participation
|
// Enable save/load participation
|
||||||
public override bool AutoRegisterForSave => true;
|
public override bool AutoRegisterForSave => true;
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
base.OnManagedAwake();
|
base.OnManagedAwake();
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ namespace Core
|
|||||||
|
|
||||||
#region Save/Load Implementation
|
#region Save/Load Implementation
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
var saveData = new PlayableDirectorSaveData
|
var saveData = new PlayableDirectorSaveData
|
||||||
{
|
{
|
||||||
@@ -77,7 +77,7 @@ namespace Core
|
|||||||
return JsonUtility.ToJson(saveData);
|
return JsonUtility.ToJson(saveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData))
|
if (string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Core
|
|||||||
// ManagedBehaviour configuration
|
// ManagedBehaviour configuration
|
||||||
public override int ManagedAwakePriority => 15; // Core infrastructure, after GameManager
|
public override int ManagedAwakePriority => 15; // Core infrastructure, after GameManager
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -63,7 +63,7 @@ namespace Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Set up loading screen reference and events
|
// Set up loading screen reference and events
|
||||||
// This must happen in ManagedStart because LoadingScreenController instance needs to be set first
|
// This must happen in ManagedStart because LoadingScreenController instance needs to be set first
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Core
|
|||||||
// ManagedBehaviour configuration
|
// ManagedBehaviour configuration
|
||||||
public override int ManagedAwakePriority => 70; // Platform-specific utility
|
public override int ManagedAwakePriority => 70; // Platform-specific utility
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -32,7 +32,7 @@ namespace Core
|
|||||||
LogDebugMessage("Initialized");
|
LogDebugMessage("Initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Subscribe to SceneManagerService to enforce orientation on every scene load
|
// Subscribe to SceneManagerService to enforce orientation on every scene load
|
||||||
if (SceneManagerService.Instance != null)
|
if (SceneManagerService.Instance != null)
|
||||||
@@ -49,7 +49,7 @@ namespace Core
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneReady()
|
internal override void OnSceneReady()
|
||||||
{
|
{
|
||||||
// Handle orientation when scene is ready (initial scene)
|
// Handle orientation when scene is ready (initial scene)
|
||||||
// Note: This fires for the scene that just loaded, LifecycleManager tracks which scene
|
// Note: This fires for the scene that just loaded, LifecycleManager tracks which scene
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ public class PicnicBehaviour : ManagedBehaviour
|
|||||||
// Runtime state tracking
|
// Runtime state tracking
|
||||||
private bool _fakeChocolateDestroyed;
|
private bool _fakeChocolateDestroyed;
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
stateMachine = GetComponent<AppleMachine>();
|
stateMachine = GetComponent<AppleMachine>();
|
||||||
animator = GetComponent<Animator>();
|
animator = GetComponent<Animator>();
|
||||||
_audioSource = GetComponent<AppleAudioSource>();
|
_audioSource = GetComponent<AppleAudioSource>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreCompleted()
|
internal override void OnSceneRestoreCompleted()
|
||||||
{
|
{
|
||||||
if (_fakeChocolateDestroyed)
|
if (_fakeChocolateDestroyed)
|
||||||
{
|
{
|
||||||
@@ -120,13 +120,13 @@ public class PicnicBehaviour : ManagedBehaviour
|
|||||||
_audioSource.Play(0);
|
_audioSource.Play(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
var state = new PicnicBehaviourState { fakeChocolateDestroyed = _fakeChocolateDestroyed };
|
var state = new PicnicBehaviourState { fakeChocolateDestroyed = _fakeChocolateDestroyed };
|
||||||
return JsonUtility.ToJson(state);
|
return JsonUtility.ToJson(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData)) return;
|
if (string.IsNullOrEmpty(serializedData)) return;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class soundBird_CanFly : ManagedBehaviour
|
|||||||
|
|
||||||
#region Save/Load Implementation
|
#region Save/Load Implementation
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
var saveData = new SoundBirdSaveData
|
var saveData = new SoundBirdSaveData
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,7 @@ public class soundBird_CanFly : ManagedBehaviour
|
|||||||
return JsonUtility.ToJson(saveData);
|
return JsonUtility.ToJson(saveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData))
|
if (string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Data.CardSystem
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 60; // Data systems
|
public override int ManagedAwakePriority => 60; // Data systems
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -56,7 +56,7 @@ namespace Data.CardSystem
|
|||||||
LoadCardDefinitionsFromAddressables();
|
LoadCardDefinitionsFromAddressables();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
Logging.Debug("[CardSystemManager] Initialized");
|
Logging.Debug("[CardSystemManager] Initialized");
|
||||||
}
|
}
|
||||||
@@ -718,13 +718,13 @@ namespace Data.CardSystem
|
|||||||
|
|
||||||
#region Save/Load Lifecycle Hooks
|
#region Save/Load Lifecycle Hooks
|
||||||
|
|
||||||
protected override string OnGlobalSaveRequested()
|
internal override string OnGlobalSaveRequested()
|
||||||
{
|
{
|
||||||
var state = ExportCardCollectionState();
|
var state = ExportCardCollectionState();
|
||||||
return JsonUtility.ToJson(state);
|
return JsonUtility.ToJson(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnGlobalRestoreRequested(string serializedData)
|
internal override void OnGlobalRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData))
|
if (string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Dialogue
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 150; // Dialogue systems
|
public override int ManagedAwakePriority => 150; // Dialogue systems
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Get required components
|
// Get required components
|
||||||
appleAudioSource = GetComponent<AppleAudioSource>();
|
appleAudioSource = GetComponent<AppleAudioSource>();
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace Input
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 25; // Input infrastructure
|
public override int ManagedAwakePriority => 25; // Input infrastructure
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -87,7 +87,7 @@ namespace Input
|
|||||||
SwitchInputOnSceneLoaded(SceneManager.GetActiveScene().name);
|
SwitchInputOnSceneLoaded(SceneManager.GetActiveScene().name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Subscribe to scene load events from SceneManagerService
|
// Subscribe to scene load events from SceneManagerService
|
||||||
// This must happen in ManagedStart because SceneManagerService instance needs to be set first
|
// This must happen in ManagedStart because SceneManagerService instance needs to be set first
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ namespace Input
|
|||||||
public override string SaveId => $"{gameObject.scene.name}/PlayerController";
|
public override string SaveId => $"{gameObject.scene.name}/PlayerController";
|
||||||
public override int ManagedAwakePriority => 100; // Player controller
|
public override int ManagedAwakePriority => 100; // Player controller
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
aiPath = GetComponent<AIPath>();
|
aiPath = GetComponent<AIPath>();
|
||||||
artTransform = transform.Find("CharacterArt");
|
artTransform = transform.Find("CharacterArt");
|
||||||
@@ -435,7 +435,7 @@ namespace Input
|
|||||||
|
|
||||||
#region Save/Load Lifecycle Hooks
|
#region Save/Load Lifecycle Hooks
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
var saveData = new PlayerSaveData
|
var saveData = new PlayerSaveData
|
||||||
{
|
{
|
||||||
@@ -445,7 +445,7 @@ namespace Input
|
|||||||
return JsonUtility.ToJson(saveData);
|
return JsonUtility.ToJson(saveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData))
|
if (string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ namespace Interactions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
base.OnManagedAwake(); // SaveableInteractable registration
|
base.OnManagedAwake(); // SaveableInteractable registration
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace Interactions
|
|||||||
public event Action<PickupItemData> OnItemPickedUp;
|
public event Action<PickupItemData> OnItemPickedUp;
|
||||||
public event Action<PickupItemData, PickupItemData, PickupItemData> OnItemsCombined;
|
public event Action<PickupItemData, PickupItemData, PickupItemData> OnItemsCombined;
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
base.OnManagedAwake(); // Register with save system
|
base.OnManagedAwake(); // Register with save system
|
||||||
|
|
||||||
@@ -44,7 +44,7 @@ namespace Interactions
|
|||||||
|
|
||||||
// Always register with ItemManager, even if picked up
|
// Always register with ItemManager, even if picked up
|
||||||
// This allows the save/load system to find held items when restoring state
|
// This allows the save/load system to find held items when restoring state
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
base.OnManagedStart();
|
base.OnManagedStart();
|
||||||
ItemManager.Instance?.RegisterPickup(this);
|
ItemManager.Instance?.RegisterPickup(this);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Interactions
|
|||||||
|
|
||||||
#region Save/Load Lifecycle Hooks
|
#region Save/Load Lifecycle Hooks
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
object stateData = GetSerializableState();
|
object stateData = GetSerializableState();
|
||||||
if (stateData == null)
|
if (stateData == null)
|
||||||
@@ -35,7 +35,7 @@ namespace Interactions
|
|||||||
return JsonUtility.ToJson(stateData);
|
return JsonUtility.ToJson(stateData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData))
|
if (string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Levels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unity Awake callback. Sets up icon, interactable, and event handlers.
|
/// Unity Awake callback. Sets up icon, interactable, and event handlers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
base.OnManagedAwake();
|
base.OnManagedAwake();
|
||||||
|
|
||||||
@@ -36,12 +36,12 @@ namespace Levels
|
|||||||
ApplySwitchData();
|
ApplySwitchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
Logging.Debug($"[LevelSwitch] OnManagedStart called for {gameObject.name}");
|
Logging.Debug($"[LevelSwitch] OnManagedStart called for {gameObject.name}");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneReady()
|
internal override void OnSceneReady()
|
||||||
{
|
{
|
||||||
Logging.Debug($"[LevelSwitch] OnSceneReady called for {gameObject.name}");
|
Logging.Debug($"[LevelSwitch] OnSceneReady called for {gameObject.name}");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ namespace Levels
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unity Awake callback. Sets up icon, interactable, and event handlers.
|
/// Unity Awake callback. Sets up icon, interactable, and event handlers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
base.OnManagedAwake();
|
base.OnManagedAwake();
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ namespace Levels
|
|||||||
ApplySwitchData();
|
ApplySwitchData();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
base.OnManagedStart();
|
base.OnManagedStart();
|
||||||
// If startUnlocked is true, always start active
|
// If startUnlocked is true, always start active
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ namespace Minigames.DivingForPictures
|
|||||||
public override int ManagedAwakePriority => 190;
|
public override int ManagedAwakePriority => 190;
|
||||||
public override bool AutoRegisterPausable => true; // Automatic GameManager registration
|
public override bool AutoRegisterPausable => true; // Automatic GameManager registration
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
if (_instance == null)
|
if (_instance == null)
|
||||||
{
|
{
|
||||||
@@ -119,7 +119,7 @@ namespace Minigames.DivingForPictures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
_settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
|
_settings = GameManager.GetSettingsObject<IDivingMinigameSettings>();
|
||||||
_currentSpawnProbability = _settings?.BaseSpawnProbability ?? 0.2f;
|
_currentSpawnProbability = _settings?.BaseSpawnProbability ?? 0.2f;
|
||||||
@@ -130,7 +130,7 @@ namespace Minigames.DivingForPictures
|
|||||||
Logging.Debug("[DivingGameManager] Initialized");
|
Logging.Debug("[DivingGameManager] Initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneReady()
|
internal override void OnSceneReady()
|
||||||
{
|
{
|
||||||
InitializeGame();
|
InitializeGame();
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class FollowerController : ManagedBehaviour
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 110; // Follower after player
|
public override int ManagedAwakePriority => 110; // Follower after player
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
_aiPath = GetComponent<AIPath>();
|
_aiPath = GetComponent<AIPath>();
|
||||||
// Find art prefab and animator
|
// Find art prefab and animator
|
||||||
@@ -129,7 +129,7 @@ public class FollowerController : ManagedBehaviour
|
|||||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneReady()
|
internal override void OnSceneReady()
|
||||||
{
|
{
|
||||||
// Find player reference when scene is ready (called for every scene load)
|
// Find player reference when scene is ready (called for every scene load)
|
||||||
FindPlayerReference();
|
FindPlayerReference();
|
||||||
@@ -727,7 +727,7 @@ public class FollowerController : ManagedBehaviour
|
|||||||
|
|
||||||
#region Save/Load Lifecycle Hooks
|
#region Save/Load Lifecycle Hooks
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
var saveData = new FollowerSaveData
|
var saveData = new FollowerSaveData
|
||||||
{
|
{
|
||||||
@@ -754,7 +754,7 @@ public class FollowerController : ManagedBehaviour
|
|||||||
return JsonUtility.ToJson(saveData);
|
return JsonUtility.ToJson(saveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData))
|
if (string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace PuzzleS
|
|||||||
// Save system configuration
|
// Save system configuration
|
||||||
public override bool AutoRegisterForSave => true;
|
public override bool AutoRegisterForSave => true;
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Initialize after all managers are ready
|
// Initialize after all managers are ready
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ namespace PuzzleS
|
|||||||
|
|
||||||
#region Save/Load Lifecycle Hooks
|
#region Save/Load Lifecycle Hooks
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
// Save scene-specific progress
|
// Save scene-specific progress
|
||||||
var state = new BirdGameState
|
var state = new BirdGameState
|
||||||
@@ -38,7 +38,7 @@ namespace PuzzleS
|
|||||||
return JsonUtility.ToJson(state);
|
return JsonUtility.ToJson(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(serializedData))
|
if (string.IsNullOrEmpty(serializedData))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace PuzzleS
|
|||||||
// Enum for tracking proximity state (simplified to just Close and Far)
|
// Enum for tracking proximity state (simplified to just Close and Far)
|
||||||
public enum ProximityState { Close, Far }
|
public enum ProximityState { Close, Far }
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
_interactable = GetComponent<InteractableBase>();
|
_interactable = GetComponent<InteractableBase>();
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ namespace PuzzleS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Register with PuzzleManager - safe to access .Instance here
|
// Register with PuzzleManager - safe to access .Instance here
|
||||||
if (stepData != null && PuzzleManager.Instance != null)
|
if (stepData != null && PuzzleManager.Instance != null)
|
||||||
|
|||||||
@@ -96,13 +96,13 @@ namespace PuzzleS
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 80; // Puzzle systems
|
public override int ManagedAwakePriority => 80; // Puzzle systems
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Initialize settings reference
|
// Initialize settings reference
|
||||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||||
@@ -589,7 +589,7 @@ namespace PuzzleS
|
|||||||
|
|
||||||
#region Save/Load Lifecycle Hooks
|
#region Save/Load Lifecycle Hooks
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
if (_currentLevelData == null)
|
if (_currentLevelData == null)
|
||||||
{
|
{
|
||||||
@@ -609,7 +609,7 @@ namespace PuzzleS
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string data)
|
internal override void OnSceneRestoreRequested(string data)
|
||||||
{
|
{
|
||||||
Logging.Debug("[XAXA] PuzzleManager loading with data: " + data);
|
Logging.Debug("[XAXA] PuzzleManager loading with data: " + data);
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,12 @@ public class AppleAudioSource : ManagedBehaviour
|
|||||||
public int sourcePriority;
|
public int sourcePriority;
|
||||||
|
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
audioSource = GetComponent<AudioSource>();
|
audioSource = GetComponent<AudioSource>();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
AudioManager.Instance.RegisterNewAudioSource(this);
|
AudioManager.Instance.RegisterNewAudioSource(this);
|
||||||
_audioMixer = AudioManager.Instance.audioMixer;
|
_audioMixer = AudioManager.Instance.audioMixer;
|
||||||
|
|||||||
@@ -44,13 +44,13 @@ public class AudioManager : ManagedBehaviour, IPausable
|
|||||||
public override int ManagedAwakePriority => 30; // Audio infrastructure
|
public override int ManagedAwakePriority => 30; // Audio infrastructure
|
||||||
public override bool AutoRegisterPausable => true; // Auto-register as IPausable
|
public override bool AutoRegisterPausable => true; // Auto-register as IPausable
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Initialize lists if they were not set in inspector
|
// Initialize lists if they were not set in inspector
|
||||||
criticalVOSources = criticalVOSources ?? new List<AppleAudioSource>();
|
criticalVOSources = criticalVOSources ?? new List<AppleAudioSource>();
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class BushAudioController : ManagedBehaviour
|
|||||||
|
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
_eventSource = VOPlayer.audioSource.RequestEventHandlers();
|
_eventSource = VOPlayer.audioSource.RequestEventHandlers();
|
||||||
_eventSource.AudioStopped += PlayBirdCounter;
|
_eventSource.AudioStopped += PlayBirdCounter;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class LevelAudioObject : ManagedBehaviour
|
|||||||
|
|
||||||
public override bool AutoRegisterForSave => isOneTime; // Only save if one-time audio
|
public override bool AutoRegisterForSave => isOneTime; // Only save if one-time audio
|
||||||
|
|
||||||
protected override string OnSceneSaveRequested()
|
internal override string OnSceneSaveRequested()
|
||||||
{
|
{
|
||||||
if (!isOneTime)
|
if (!isOneTime)
|
||||||
return null; // No need to save if not one-time
|
return null; // No need to save if not one-time
|
||||||
@@ -39,7 +39,7 @@ public class LevelAudioObject : ManagedBehaviour
|
|||||||
return JsonUtility.ToJson(saveData);
|
return JsonUtility.ToJson(saveData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreRequested(string serializedData)
|
internal override void OnSceneRestoreRequested(string serializedData)
|
||||||
{
|
{
|
||||||
if (!isOneTime || string.IsNullOrEmpty(serializedData))
|
if (!isOneTime || string.IsNullOrEmpty(serializedData))
|
||||||
return;
|
return;
|
||||||
@@ -55,7 +55,7 @@ public class LevelAudioObject : ManagedBehaviour
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneRestoreCompleted()
|
internal override void OnSceneRestoreCompleted()
|
||||||
{
|
{
|
||||||
if (isOneTime && !_hasPlayed)
|
if (isOneTime && !_hasPlayed)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class PulverAudioController : ManagedBehaviour
|
|||||||
private FollowerController followerController;
|
private FollowerController followerController;
|
||||||
public ItemManager itemManager;
|
public ItemManager itemManager;
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
followerController = GetComponent<FollowerController>();
|
followerController = GetComponent<FollowerController>();
|
||||||
followerController.PulverIsCombining.AddListener(PulverIsCombining);
|
followerController.PulverIsCombining.AddListener(PulverIsCombining);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class AppSwitcher : UIPage
|
|||||||
private TweenBase slideInTween;
|
private TweenBase slideInTween;
|
||||||
private TweenBase slideOutTween;
|
private TweenBase slideOutTween;
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
base.OnManagedAwake();
|
base.OnManagedAwake();
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace UI.CardSystem
|
|||||||
private List<AlbumCardPlacementDraggable> _activeCards = new List<AlbumCardPlacementDraggable>();
|
private List<AlbumCardPlacementDraggable> _activeCards = new List<AlbumCardPlacementDraggable>();
|
||||||
private const int MAX_VISIBLE_CARDS = 3;
|
private const int MAX_VISIBLE_CARDS = 3;
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Discover zone tabs from container
|
// Discover zone tabs from container
|
||||||
DiscoverZoneTabs();
|
DiscoverZoneTabs();
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ namespace UI.CardSystem
|
|||||||
|
|
||||||
private TweenBase _activeTween;
|
private TweenBase _activeTween;
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Store original scale for pulse animation
|
// Store original scale for pulse animation
|
||||||
if (dotBackground != null)
|
if (dotBackground != null)
|
||||||
|
|||||||
@@ -39,13 +39,13 @@ namespace UI.Core
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 50; // UI infrastructure
|
public override int ManagedAwakePriority => 50; // UI infrastructure
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
Logging.Debug("[UIPageController] Initialized");
|
Logging.Debug("[UIPageController] Initialized");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace UI
|
|||||||
// ManagedBehaviour configuration
|
// ManagedBehaviour configuration
|
||||||
public override int ManagedAwakePriority => 45; // UI infrastructure, before UIPageController
|
public override int ManagedAwakePriority => 45; // UI infrastructure, before UIPageController
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -72,7 +72,7 @@ namespace UI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
Logging.Debug("[LoadingScreenController] Initialized");
|
Logging.Debug("[LoadingScreenController] Initialized");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace UI
|
|||||||
// After UIPageController (50)
|
// After UIPageController (50)
|
||||||
public override int ManagedAwakePriority => 55;
|
public override int ManagedAwakePriority => 55;
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
// Set instance immediately (early initialization)
|
// Set instance immediately (early initialization)
|
||||||
_instance = this;
|
_instance = this;
|
||||||
@@ -49,7 +49,7 @@ namespace UI
|
|||||||
gameObject.SetActive(false);
|
gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Subscribe to scene-dependent events - must be in OnManagedStart, not OnSceneReady
|
// Subscribe to scene-dependent events - must be in OnManagedStart, not OnSceneReady
|
||||||
// because PauseMenu is in DontDestroyOnLoad and OnSceneReady only fires once
|
// because PauseMenu is in DontDestroyOnLoad and OnSceneReady only fires once
|
||||||
@@ -71,7 +71,7 @@ namespace UI
|
|||||||
Logging.Debug("[PauseMenu] Subscribed to SceneManagerService events");
|
Logging.Debug("[PauseMenu] Subscribed to SceneManagerService events");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnSceneReady()
|
internal override void OnSceneReady()
|
||||||
{
|
{
|
||||||
// This only fires once for DontDestroyOnLoad objects, so we handle scene loads in OnManagedAwake
|
// This only fires once for DontDestroyOnLoad objects, so we handle scene loads in OnManagedAwake
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace UI
|
|||||||
private UIPageController _uiPageController;
|
private UIPageController _uiPageController;
|
||||||
private AppSwitcher _appSwitcherComponent;
|
private AppSwitcher _appSwitcherComponent;
|
||||||
|
|
||||||
protected override void OnManagedAwake()
|
internal override void OnManagedAwake()
|
||||||
{
|
{
|
||||||
if (Instance != null)
|
if (Instance != null)
|
||||||
{
|
{
|
||||||
@@ -135,7 +135,7 @@ namespace UI
|
|||||||
InitializeReferences();
|
InitializeReferences();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Subscribe to UIPageController page changes for auto HUD management
|
// Subscribe to UIPageController page changes for auto HUD management
|
||||||
if (_uiPageController != null)
|
if (_uiPageController != null)
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ namespace UI.Tutorial
|
|||||||
|
|
||||||
public override int ManagedAwakePriority => 200; // Tutorial runs late, after other systems
|
public override int ManagedAwakePriority => 200; // Tutorial runs late, after other systems
|
||||||
|
|
||||||
protected override void OnManagedStart()
|
internal override void OnManagedStart()
|
||||||
{
|
{
|
||||||
// Ensure prompt is hidden initially (even before tutorial initialization)
|
// Ensure prompt is hidden initially (even before tutorial initialization)
|
||||||
if (tapPrompt != null)
|
if (tapPrompt != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user