stash work
This commit is contained in:
@@ -44,22 +44,17 @@ namespace Bootstrap
|
||||
// Show the loading screen immediately with our combined progress provider
|
||||
initialLoadingScreen.ShowLoadingScreen(GetCombinedProgress);
|
||||
|
||||
// Start the boot process if not already initialized
|
||||
if (!CustomBoot.Initialised)
|
||||
{
|
||||
// Subscribe to the boot completion event
|
||||
CustomBoot.OnBootCompleted += OnBootCompleted;
|
||||
// Subscribe to boot progress events
|
||||
CustomBoot.OnBootProgressChanged += OnBootProgressChanged;
|
||||
|
||||
// Start initialization
|
||||
CustomBoot.PerformInitialisation();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If already initialized (can happen in editor testing), proceed immediately
|
||||
Debug.Log("[BootSceneController] Bootstrap already initialized, proceeding to main menu");
|
||||
OnBootCompleted();
|
||||
}
|
||||
// Register our boot completion handler with the BootCompletionService
|
||||
// This will execute either immediately if boot is already complete,
|
||||
// or when the boot process completes
|
||||
BootCompletionService.RegisterInitAction(
|
||||
OnBootCompleted,
|
||||
50, // Higher priority (lower number)
|
||||
"BootSceneController.OnBootCompleted"
|
||||
);
|
||||
|
||||
// In debug mode, log additional information
|
||||
if (debugMode)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Bootstrap;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
@@ -27,31 +28,26 @@ namespace Cinematics
|
||||
private Dictionary<PlayableDirector, AsyncOperationHandle<PlayableAsset>> _addressableHandles
|
||||
= new Dictionary<PlayableDirector, AsyncOperationHandle<PlayableAsset>>();
|
||||
|
||||
public static CinematicsManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<CinematicsManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("CinematicsManager");
|
||||
_instance = go.AddComponent<CinematicsManager>();
|
||||
// DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singleton instance of the CinematicsManager. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static CinematicsManager Instance => _instance;
|
||||
|
||||
public PlayableDirector playableDirector;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
|
||||
// Initialize required components
|
||||
InitializeComponents();
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Initialize any dependencies that require other services to be ready
|
||||
// For example, subscribe to SceneManagerService events if needed
|
||||
Logging.Debug("[CinematicsManager] Post-boot initialization complete");
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
|
||||
@@ -32,23 +32,6 @@ namespace Cinematics
|
||||
}
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// Only handle the case where the GameObject is enabled after boot is already complete
|
||||
if (!_initialized && BootCompletionService.IsBootComplete)
|
||||
{
|
||||
// Boot is already complete but we haven't initialized yet, do it now
|
||||
Logging.Debug("[SkipCinematic] OnEnable: Boot already complete, initializing now");
|
||||
InitializePostBoot();
|
||||
}
|
||||
else if (_initialized)
|
||||
{
|
||||
// If we're already initialized, just ensure subscriptions are active
|
||||
SubscribeToCinematicsEvents();
|
||||
}
|
||||
// If boot isn't complete, our InitializePostBoot method will be called via the BootCompletionService
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
// Clean up subscriptions regardless of initialization state
|
||||
|
||||
@@ -16,25 +16,9 @@ public class GameManager : MonoBehaviour
|
||||
private static bool _isQuitting = false;
|
||||
|
||||
/// <summary>
|
||||
/// Singleton instance of the GameManager.
|
||||
/// Singleton instance of the GameManager. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static GameManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<GameManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("GameManager");
|
||||
_instance = go.AddComponent<GameManager>();
|
||||
// DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
public static GameManager Instance => _instance;
|
||||
|
||||
[Header("Settings Status")]
|
||||
[SerializeField] private bool _settingsLoaded = false;
|
||||
@@ -77,11 +61,6 @@ public class GameManager : MonoBehaviour
|
||||
// DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// PauseMenu subscription moved to InitializePostBoot
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Find and subscribe to PauseMenu events
|
||||
|
||||
@@ -15,23 +15,10 @@ namespace Core
|
||||
private static ItemManager _instance;
|
||||
private static bool _isQuitting;
|
||||
|
||||
public static ItemManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<ItemManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("ItemManager");
|
||||
_instance = go.AddComponent<ItemManager>();
|
||||
// DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singleton instance of the ItemManager. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static ItemManager Instance => _instance;
|
||||
|
||||
private readonly HashSet<Pickup> _pickups = new HashSet<Pickup>();
|
||||
private readonly HashSet<ItemSlot> _itemSlots = new HashSet<ItemSlot>();
|
||||
@@ -69,11 +56,6 @@ namespace Core
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
// SceneManagerService subscription moved to InitializePostBoot
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to scene load completed so we can clear registrations when scenes change
|
||||
|
||||
@@ -18,22 +18,10 @@ namespace AppleHills.Core
|
||||
private static QuickAccess _instance;
|
||||
private static bool _isQuitting = false;
|
||||
|
||||
public static QuickAccess Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<QuickAccess>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("QuickAccess");
|
||||
_instance = go.AddComponent<QuickAccess>();
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singleton instance of QuickAccess. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static QuickAccess Instance => _instance;
|
||||
|
||||
void OnApplicationQuit()
|
||||
{
|
||||
@@ -146,6 +134,8 @@ namespace AppleHills.Core
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
|
||||
if (!_initialized)
|
||||
{
|
||||
// Subscribe to scene changes
|
||||
|
||||
@@ -16,26 +16,11 @@ namespace Core
|
||||
private LoadingScreenController _loadingScreen;
|
||||
private static SceneManagerService _instance;
|
||||
private static bool _isQuitting = false;
|
||||
|
||||
/// <summary>
|
||||
/// Singleton instance of the SceneManagerService.
|
||||
/// Singleton instance of the SceneManagerService. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static SceneManagerService Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<SceneManagerService>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("SceneManagerService");
|
||||
_instance = go.AddComponent<SceneManagerService>();
|
||||
// DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
public static SceneManagerService Instance => _instance;
|
||||
|
||||
// Events for scene lifecycle
|
||||
public event Action<string> SceneLoadStarted;
|
||||
@@ -99,11 +84,6 @@ namespace Core
|
||||
}
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
// LoadingScreen setup moved to InitializePostBoot
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Set up loading screen reference and events after boot is complete
|
||||
|
||||
@@ -5,6 +5,8 @@ using Input;
|
||||
using Settings;
|
||||
using System.Collections;
|
||||
using Minigames.DivingForPictures;
|
||||
using Bootstrap;
|
||||
using Core;
|
||||
|
||||
namespace Utility
|
||||
{
|
||||
@@ -12,23 +14,11 @@ namespace Utility
|
||||
{
|
||||
private static SceneOrientationEnforcer _instance;
|
||||
private static bool _isQuitting;
|
||||
public static SceneOrientationEnforcer Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<SceneOrientationEnforcer>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("SceneOrientationEnforcer");
|
||||
_instance = go.AddComponent<SceneOrientationEnforcer>();
|
||||
// DontDestroyOnLoad(go); // Uncomment if you want persistence
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Singleton instance of the SceneOrientationEnforcer. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static SceneOrientationEnforcer Instance => _instance;
|
||||
|
||||
[Header("Config")]
|
||||
public SceneOrientationConfig orientationConfig;
|
||||
@@ -48,10 +38,16 @@ namespace Utility
|
||||
{
|
||||
_instance = this;
|
||||
OnOrientationCorrect += HandleOrientationCorrect;
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
void Start()
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Initialize any dependencies that require other services to be ready
|
||||
Logging.Debug("[SceneOrientationEnforcer] Post-boot initialization complete");
|
||||
|
||||
// Subscribe to sceneLoaded event
|
||||
SceneManager.sceneLoaded += OnSceneLoaded;
|
||||
// Manually invoke for the first scene (unless it's Main Menu)
|
||||
@@ -74,6 +70,8 @@ namespace Utility
|
||||
return Screen.orientation == ScreenOrientation.Portrait || Screen.orientation == ScreenOrientation.PortraitUpsideDown;
|
||||
case ScreenOrientationRequirement.Landscape:
|
||||
return Screen.orientation == ScreenOrientation.LandscapeLeft || Screen.orientation == ScreenOrientation.LandscapeRight;
|
||||
case ScreenOrientationRequirement.NotApplicable:
|
||||
return true;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
@@ -98,7 +96,7 @@ namespace Utility
|
||||
|
||||
_isDivingMinigame = IsDivingMinigameScene(scene);
|
||||
|
||||
_requiredOrientation = orientationConfig != null ? orientationConfig.GetRequirementForScene(scene.name) : ScreenOrientationRequirement.Portrait;
|
||||
_requiredOrientation = orientationConfig != null ? orientationConfig.GetRequirementForScene(scene.name) : ScreenOrientationRequirement.NotApplicable;
|
||||
_orientationCorrect = IsOrientationCorrect();
|
||||
|
||||
if (!_orientationCorrect)
|
||||
@@ -186,7 +184,7 @@ namespace Utility
|
||||
_orientationCheckCoroutine = null;
|
||||
}
|
||||
|
||||
InputManager.Instance.SetInputMode(InputMode.Game);
|
||||
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
}
|
||||
|
||||
private void CleanupPromptAndCoroutine()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using AppleHills.Data.CardSystem;
|
||||
using Bootstrap;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -61,6 +62,15 @@ namespace Data.CardSystem
|
||||
|
||||
// Build lookup dictionary
|
||||
BuildDefinitionLookup();
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Initialize any dependencies that require other services to be ready
|
||||
Logging.Debug("[CardSystemManager] Post-boot initialization complete");
|
||||
}
|
||||
|
||||
private void OnApplicationQuit()
|
||||
|
||||
@@ -36,22 +36,10 @@ namespace Input
|
||||
// Track which consumer is handling the current hold operation
|
||||
private ITouchInputConsumer _activeHoldConsumer;
|
||||
|
||||
public static InputManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<InputManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("InputManager");
|
||||
_instance = go.AddComponent<InputManager>();
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singleton instance of the InputManager. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static InputManager Instance => _instance;
|
||||
|
||||
// Settings reference
|
||||
private IInteractionSettings _interactionSettings;
|
||||
@@ -67,6 +55,15 @@ namespace Input
|
||||
{
|
||||
_instance = this;
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to scene load completed events now that boot is complete
|
||||
SceneManagerService.Instance.SceneLoadCompleted += SwitchInputOnSceneLoaded;
|
||||
|
||||
// Initialize settings reference
|
||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
|
||||
@@ -80,20 +77,16 @@ namespace Input
|
||||
holdMoveAction = playerInput.actions.FindAction("HoldMove", false);
|
||||
positionAction = playerInput.actions.FindAction("TouchPosition", false);
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
if (tapMoveAction != null)
|
||||
tapMoveAction.performed += OnTapMovePerformed;
|
||||
if (holdMoveAction != null)
|
||||
{
|
||||
holdMoveAction.performed += OnHoldMoveStarted;
|
||||
holdMoveAction.canceled += OnHoldMoveCanceled;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// SceneManagerService subscription moved to InitializePostBoot
|
||||
SwitchInputOnSceneLoaded(SceneManager.GetActiveScene().name);
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to scene load completed events now that boot is complete
|
||||
SceneManagerService.Instance.SceneLoadCompleted += SwitchInputOnSceneLoaded;
|
||||
Logging.Debug("[InputManager] Subscribed to SceneManagerService events");
|
||||
}
|
||||
|
||||
@@ -141,17 +134,6 @@ namespace Input
|
||||
}
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (tapMoveAction != null)
|
||||
tapMoveAction.performed += OnTapMovePerformed;
|
||||
if (holdMoveAction != null)
|
||||
{
|
||||
holdMoveAction.performed += OnHoldMoveStarted;
|
||||
holdMoveAction.canceled += OnHoldMoveCanceled;
|
||||
}
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
if (tapMoveAction != null)
|
||||
|
||||
@@ -36,25 +36,9 @@ namespace PuzzleS
|
||||
private bool _isLoadingLevelData = false;
|
||||
|
||||
/// <summary>
|
||||
/// Singleton instance of the PuzzleManager.
|
||||
/// Singleton instance of the PuzzleManager. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static PuzzleManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<PuzzleManager>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("PuzzleManager");
|
||||
_instance = go.AddComponent<PuzzleManager>();
|
||||
// DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
public static PuzzleManager Instance => _instance;
|
||||
|
||||
// Events to notify about step lifecycle
|
||||
public event Action<PuzzleStepSO> OnStepCompleted;
|
||||
@@ -70,7 +54,6 @@ namespace PuzzleS
|
||||
void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
// DontDestroyOnLoad(gameObject);
|
||||
|
||||
// Initialize settings reference
|
||||
_interactionSettings = GameManager.GetSettingsObject<IInteractionSettings>();
|
||||
@@ -79,15 +62,10 @@ namespace PuzzleS
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to scene manager events
|
||||
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
// SceneManagerService subscription moved to InitializePostBoot
|
||||
// Subscribe to SceneManagerService events after boot is complete
|
||||
SceneManagerService.Instance.SceneLoadCompleted += OnSceneLoadCompleted;
|
||||
|
||||
// Find player transform
|
||||
_playerTransform = GameObject.FindGameObjectWithTag("Player")?.transform;
|
||||
@@ -100,12 +78,7 @@ namespace PuzzleS
|
||||
{
|
||||
LoadPuzzleDataForCurrentScene();
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to SceneManagerService events after boot is complete
|
||||
SceneManagerService.Instance.SceneLoadCompleted += OnSceneLoadCompleted;
|
||||
Logging.Debug("[PuzzleManager] Subscribed to SceneManagerService events");
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Settings
|
||||
return entry.requiredOrientation;
|
||||
}
|
||||
// Default to Portrait if not found
|
||||
return ScreenOrientationRequirement.Portrait;
|
||||
return ScreenOrientationRequirement.NotApplicable;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
public enum ScreenOrientationRequirement
|
||||
{
|
||||
Portrait,
|
||||
Landscape
|
||||
Landscape,
|
||||
NotApplicable
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Bootstrap;
|
||||
using Core;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -29,6 +30,15 @@ namespace AppleHills.UI.CardSystem
|
||||
}
|
||||
|
||||
_instance = this;
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Initialize any dependencies that require other services to be ready
|
||||
Logging.Debug("[UIPageController] Post-boot initialization complete");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections;
|
||||
using System;
|
||||
using Bootstrap;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Core;
|
||||
@@ -48,22 +49,10 @@ namespace UI
|
||||
/// </summary>
|
||||
public bool IsActive => loadingScreenContainer != null && loadingScreenContainer.activeSelf;
|
||||
|
||||
public static LoadingScreenController Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<LoadingScreenController>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("LoadingScreenController");
|
||||
_instance = go.AddComponent<LoadingScreenController>();
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singleton instance of the LoadingScreenController. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static LoadingScreenController Instance => _instance;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@@ -77,6 +66,15 @@ namespace UI
|
||||
{
|
||||
loadingScreenContainer.SetActive(false);
|
||||
}
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Initialize any dependencies that require other services to be ready
|
||||
Logging.Debug("[LoadingScreenController] Post-boot initialization complete");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -12,23 +12,10 @@ namespace UI
|
||||
private static PauseMenu _instance;
|
||||
private static bool _isQuitting;
|
||||
|
||||
public static PauseMenu Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null && Application.isPlaying && !_isQuitting)
|
||||
{
|
||||
_instance = FindAnyObjectByType<PauseMenu>();
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("PauseMenu");
|
||||
_instance = go.AddComponent<PauseMenu>();
|
||||
// DontDestroyOnLoad(go);
|
||||
}
|
||||
}
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Singleton instance of the PauseMenu. No longer creates an instance if one doesn't exist.
|
||||
/// </summary>
|
||||
public static PauseMenu Instance => _instance;
|
||||
|
||||
[Header("UI References")]
|
||||
[SerializeField] private GameObject pauseMenuPanel;
|
||||
@@ -52,8 +39,11 @@ namespace UI
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
private void Start()
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to scene loaded events
|
||||
SceneManagerService.Instance.SceneLoadCompleted += SetPauseMenuByLevel;
|
||||
|
||||
// SceneManagerService subscription moved to InitializePostBoot
|
||||
|
||||
// Set initial state based on current scene
|
||||
@@ -63,12 +53,7 @@ namespace UI
|
||||
// Initialize pause menu state
|
||||
HidePauseMenu(false);
|
||||
#endif
|
||||
}
|
||||
|
||||
private void InitializePostBoot()
|
||||
{
|
||||
// Subscribe to scene loaded events
|
||||
SceneManagerService.Instance.SceneLoadCompleted += SetPauseMenuByLevel;
|
||||
Logging.Debug("[PauseMenu] Subscribed to SceneManagerService events");
|
||||
}
|
||||
|
||||
|
||||
207
Assets/Scripts/found_instances
Normal file
207
Assets/Scripts/found_instances
Normal file
@@ -0,0 +1,207 @@
|
||||
Targets
|
||||
Occurrences of '.Instance' in Directory C:\Users\info\Desktop\repos\AppleHillsProduction\Assets\Scripts
|
||||
Found usages (163 usages found)
|
||||
<AppleHillsScripts> (163 usages found)
|
||||
Assets (163 usages found)
|
||||
Scripts (163 usages found)
|
||||
Bootstrap (3 usages found)
|
||||
BootSceneController.cs (3 usages found)
|
||||
79 if (CinematicsManager.Instance != null)
|
||||
84 CinematicsManager.Instance.LoadAndPlayCinematic("IntroSequence");
|
||||
205 SceneManagerService.Instance.CurrentGameplayScene = mainMenuSceneName;
|
||||
Cinematics (16 usages found)
|
||||
SkipCinematic.cs (16 usages found)
|
||||
57 if (CinematicsManager.Instance == null) return;
|
||||
63 CinematicsManager.Instance.OnCinematicStarted += HandleCinematicStarted;
|
||||
64 CinematicsManager.Instance.OnCinematicStopped += HandleCinematicStopped;
|
||||
67 if (CinematicsManager.Instance.IsCinematicPlaying)
|
||||
75 if (CinematicsManager.Instance != null)
|
||||
77 CinematicsManager.Instance.OnCinematicStarted -= HandleCinematicStarted;
|
||||
78 CinematicsManager.Instance.OnCinematicStopped -= HandleCinematicStopped;
|
||||
83 if (InputManager.Instance != null)
|
||||
85 InputManager.Instance.UnregisterOverrideConsumer(this);
|
||||
92 if (InputManager.Instance != null)
|
||||
94 InputManager.Instance.RegisterOverrideConsumer(this);
|
||||
100 if (InputManager.Instance != null)
|
||||
102 InputManager.Instance.UnregisterOverrideConsumer(this);
|
||||
109 if (_isHolding && CinematicsManager.Instance.IsCinematicPlaying)
|
||||
131 CinematicsManager.Instance.SkipCurrentCinematic();
|
||||
141 InputManager.Instance.UnregisterOverrideConsumer(this);
|
||||
Core (25 usages found)
|
||||
GameManager.cs (8 usages found)
|
||||
65 SettingsProvider.Instance.gameObject.name = "Settings Provider";
|
||||
68 DeveloperSettingsProvider.Instance.gameObject.name = "Developer Settings Provider";
|
||||
88 PauseMenu pauseMenu = PauseMenu.Instance;
|
||||
220 var playerSettings = SettingsProvider.Instance.LoadSettingsSynchronous<PlayerFollowerSettings>();
|
||||
221 var interactionSettings = SettingsProvider.Instance.LoadSettingsSynchronous<InteractionSettings>();
|
||||
222 var minigameSettings = SettingsProvider.Instance.LoadSettingsSynchronous<DivingMinigameSettings>();
|
||||
275 var divingDevSettings = DeveloperSettingsProvider.Instance.GetSettings<DivingDeveloperSettings>();
|
||||
318 return DeveloperSettingsProvider.Instance?.GetSettings<T>();
|
||||
ItemManager.cs (3 usages found)
|
||||
80 SceneManagerService.Instance.SceneLoadStarted += OnSceneLoadStarted;
|
||||
87 if (SceneManagerService.Instance != null)
|
||||
88 SceneManagerService.Instance.SceneLoadStarted -= OnSceneLoadStarted;
|
||||
QuickAccess.cs (7 usages found)
|
||||
47 public GameManager GameManager => GameManager.Instance;
|
||||
48 public ItemManager ItemManager => ItemManager.Instance;
|
||||
49 public SceneManagerService SceneManager => SceneManagerService.Instance;
|
||||
52 public InputManager InputManager => InputManager.Instance;
|
||||
53 public PuzzleManager PuzzleManager => PuzzleManager.Instance;
|
||||
54 public CinematicsManager CinematicsManager => CinematicsManager.Instance;
|
||||
55 public CardSystemManager CardSystemManager => CardSystemManager.Instance;
|
||||
SceneManagerService.cs (1 usage found)
|
||||
110 _loadingScreen = LoadingScreenController.Instance;
|
||||
SceneOrientationEnforcer.cs (3 usages found)
|
||||
106 InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
159 InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
189 InputManager.Instance.SetInputMode(InputMode.Game);
|
||||
SettingsAccess.cs (3 usages found)
|
||||
43 return GameManager.Instance.PlayerStopDistance;
|
||||
55 return GameManager.Instance.PlayerStopDistanceDirectInteraction;
|
||||
67 return GameManager.Instance.DefaultPuzzlePromptRange;
|
||||
Dialogue (26 usages found)
|
||||
DialogueComponent.cs (26 usages found)
|
||||
39 if (PuzzleManager.Instance != null)
|
||||
40 PuzzleManager.Instance.OnStepCompleted += OnAnyPuzzleStepCompleted;
|
||||
42 if (ItemManager.Instance != null)
|
||||
44 ItemManager.Instance.OnItemPickedUp += OnAnyItemPickedUp;
|
||||
45 ItemManager.Instance.OnCorrectItemSlotted += OnAnyItemSlotted;
|
||||
46 ItemManager.Instance.OnIncorrectItemSlotted += OnAnyIncorrectItemSlotted;
|
||||
47 ItemManager.Instance.OnForbiddenItemSlotted += OnAnyForbiddenItemSlotted;
|
||||
48 ItemManager.Instance.OnItemSlotCleared += OnAnyItemSlotCleared;
|
||||
49 ItemManager.Instance.OnItemsCombined += OnAnyItemsCombined;
|
||||
170 if (PuzzleManager.Instance != null)
|
||||
171 PuzzleManager.Instance.OnStepCompleted -= OnAnyPuzzleStepCompleted;
|
||||
173 if (ItemManager.Instance != null)
|
||||
175 ItemManager.Instance.OnItemPickedUp -= OnAnyItemPickedUp;
|
||||
176 ItemManager.Instance.OnCorrectItemSlotted -= OnAnyItemSlotted;
|
||||
177 ItemManager.Instance.OnIncorrectItemSlotted -= OnAnyIncorrectItemSlotted;
|
||||
178 ItemManager.Instance.OnForbiddenItemSlotted -= OnAnyForbiddenItemSlotted;
|
||||
179 ItemManager.Instance.OnItemSlotCleared -= OnAnyItemSlotCleared;
|
||||
180 ItemManager.Instance.OnItemsCombined -= OnAnyItemsCombined;
|
||||
600 return PuzzleManager.Instance != null &&
|
||||
601 PuzzleManager.Instance.IsPuzzleStepCompleted(stepID);
|
||||
606 if (ItemManager.Instance == null) return false;
|
||||
609 foreach (var pickup in ItemManager.Instance.Pickups)
|
||||
622 if (ItemManager.Instance == null) return false;
|
||||
625 foreach (var slot in ItemManager.Instance.ItemSlots)
|
||||
638 if (ItemManager.Instance == null) return false;
|
||||
641 return ItemManager.Instance.WasItemCreatedThroughCombination(resultItemId);
|
||||
Input (4 usages found)
|
||||
InputManager.cs (3 usages found)
|
||||
96 SceneManagerService.Instance.SceneLoadCompleted += SwitchInputOnSceneLoaded;
|
||||
103 if (SceneManagerService.Instance != null)
|
||||
104 SceneManagerService.Instance.SceneLoadCompleted -= SwitchInputOnSceneLoaded;
|
||||
PlayerTouchController.cs (1 usage found)
|
||||
77 InputManager.Instance?.SetDefaultConsumer(this);
|
||||
Interactions (6 usages found)
|
||||
Interactable.cs (2 usages found)
|
||||
213 ? GameManager.Instance.PlayerStopDistance
|
||||
214 : GameManager.Instance.PlayerStopDistanceDirectInteraction;
|
||||
ItemSlot.cs (2 usages found)
|
||||
222 ItemManager.Instance?.RegisterItemSlot(this);
|
||||
227 ItemManager.Instance?.UnregisterItemSlot(this);
|
||||
Pickup.cs (2 usages found)
|
||||
49 ItemManager.Instance?.RegisterPickup(this);
|
||||
64 ItemManager.Instance?.UnregisterPickup(this);
|
||||
LevelS (3 usages found)
|
||||
LevelSwitch.cs (3 usages found)
|
||||
114 InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
120 await SceneManagerService.Instance.SwitchSceneAsync(switchData.targetLevelSceneName, progress);
|
||||
126 InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
Minigames (43 usages found)
|
||||
DivingForPictures (43 usages found)
|
||||
Bubbles (2 usages found)
|
||||
BubbleSpawner.cs (2 usages found)
|
||||
70 DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
78 DivingGameManager.Instance.UnregisterPausableComponent(this);
|
||||
Obstacles (5 usages found)
|
||||
ObstacleSpawner.cs (5 usages found)
|
||||
88 DivingGameManager.Instance.OnGameInitialized += Initialize;
|
||||
91 DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
94 if (DivingGameManager.Instance.GetType().GetField("_isGameInitialized",
|
||||
96 System.Reflection.BindingFlags.Instance)?.GetValue(DivingGameManager.Instance) is bool isInitialized && isInitialized)
|
||||
104 DivingGameManager.Instance.UnregisterPausableComponent(this);
|
||||
PictureCamera (2 usages found)
|
||||
Viewfinder.cs (2 usages found)
|
||||
89 InputManager.Instance.RegisterOverrideConsumer(this);
|
||||
94 InputManager.Instance.UnregisterOverrideConsumer(this);
|
||||
Player (6 usages found)
|
||||
PlayerCollisionBehavior.cs (1 usage found)
|
||||
262 .GetField("_targetFingerX", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
|
||||
PlayerController.cs (5 usages found)
|
||||
83 DivingGameManager.Instance.OnGameInitialized += Initialize;
|
||||
86 if (DivingGameManager.Instance.GetType().GetField("_isGameInitialized",
|
||||
88 System.Reflection.BindingFlags.Instance)?.GetValue(DivingGameManager.Instance) is bool isInitialized && isInitialized)
|
||||
102 InputManager.Instance?.SetDefaultConsumer(this);
|
||||
110 DivingGameManager.Instance.OnGameInitialized -= Initialize;
|
||||
Tiles (5 usages found)
|
||||
TrenchTileSpawner.cs (5 usages found)
|
||||
171 DivingGameManager.Instance.OnGameInitialized += Initialize;
|
||||
174 DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
177 if (DivingGameManager.Instance.GetType().GetField("_isGameInitialized",
|
||||
179 System.Reflection.BindingFlags.Instance)?.GetValue(DivingGameManager.Instance) is bool isInitialized && isInitialized)
|
||||
187 DivingGameManager.Instance.UnregisterPausableComponent(this);
|
||||
Utilities (2 usages found)
|
||||
BottlePauser.cs (1 usage found)
|
||||
14 DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
RockPauser.cs (1 usage found)
|
||||
15 DivingGameManager.Instance.RegisterPausableComponent(this);
|
||||
DivingGameManager.cs (16 usages found)
|
||||
142 PauseMenu pauseMenu = PauseMenu.Instance;
|
||||
156 if (GameManager.Instance != null)
|
||||
158 GameManager.Instance.RegisterPausableComponent(this);
|
||||
162 if (SceneOrientationEnforcer.Instance != null)
|
||||
164 SceneOrientationEnforcer.Instance.OnOrientationCorrect += InitializeGame;
|
||||
165 SceneOrientationEnforcer.Instance.OnOrientationIncorrect += Pause;
|
||||
169 if (SceneOrientationEnforcer.Instance.IsOrientationCorrect())
|
||||
186 viewfinderManager = CameraViewfinderManager.Instance;
|
||||
212 if (SceneOrientationEnforcer.Instance != null)
|
||||
214 SceneOrientationEnforcer.Instance.OnOrientationCorrect -= InitializeGame;
|
||||
215 SceneOrientationEnforcer.Instance.OnOrientationIncorrect -= Pause;
|
||||
219 PauseMenu pauseMenu = PauseMenu.Instance;
|
||||
227 if (GameManager.Instance != null)
|
||||
229 GameManager.Instance.UnregisterPausableComponent(this);
|
||||
801 InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
822 InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
DivingScoreUI.cs (5 usages found)
|
||||
15 DivingGameManager.Instance.OnScoreChanged += UpdateScoreDisplay;
|
||||
16 DivingGameManager.Instance.OnPictureTaken += ShowScorePopup;
|
||||
19 UpdateScoreDisplay(DivingGameManager.Instance.PlayerScore);
|
||||
32 DivingGameManager.Instance.OnScoreChanged -= UpdateScoreDisplay;
|
||||
33 DivingGameManager.Instance.OnPictureTaken -= ShowScorePopup;
|
||||
PuzzleS (7 usages found)
|
||||
ObjectiveStepBehaviour.cs (3 usages found)
|
||||
76 PuzzleManager.Instance?.RegisterStepBehaviour(this);
|
||||
86 PuzzleManager.Instance?.UnregisterStepBehaviour(this);
|
||||
304 PuzzleManager.Instance?.MarkPuzzleStepCompleted(stepData);
|
||||
PuzzleManager.cs (4 usages found)
|
||||
102 SceneManagerService.Instance.SceneLoadCompleted += OnSceneLoadCompleted;
|
||||
111 if (SceneManagerService.Instance != null)
|
||||
113 SceneManagerService.Instance.SceneLoadCompleted -= OnSceneLoadCompleted;
|
||||
149 string currentScene = sceneName ?? SceneManagerService.Instance.CurrentGameplayScene;
|
||||
StateMachines (2 usages found)
|
||||
Quarry (2 usages found)
|
||||
AnneLise (2 usages found)
|
||||
TakePhotoState.cs (2 usages found)
|
||||
39 InputManager.Instance.SetInputMode(InputMode.InputDisabled);
|
||||
47 InputManager.Instance.SetInputMode(InputMode.Game);
|
||||
UI (21 usages found)
|
||||
Tutorial (2 usages found)
|
||||
DivingTutorial.cs (2 usages found)
|
||||
30 InputManager.Instance.RegisterOverrideConsumer(this);
|
||||
39 InputManager.Instance.UnregisterOverrideConsumer(this);
|
||||
MainMenu.cs (1 usage found)
|
||||
12 await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
|
||||
PauseMenu.cs (11 usages found)
|
||||
71 SceneManagerService.Instance.SceneLoadCompleted += SetPauseMenuByLevel;
|
||||
78 if (SceneManagerService.Instance != null)
|
||||
80 SceneManagerService.Instance.SceneLoadCompleted -= SetPauseMenuByLevel;
|
||||
122 InputManager.Instance.SetInputMode(InputMode.UI);
|
||||
141 InputManager.Instance.SetInputMode(InputMode.GameAndUI);
|
||||
162 await SceneManagerService.Instance.SwitchSceneAsync("MainMenu", progress);
|
||||
180 await SceneManagerService.Instance.ReloadCurrentScene(progress);
|
||||
198 await SceneManagerService.Instance.SwitchSceneAsync("MainMenu", progress);
|
||||
201 await SceneManagerService.Instance.SwitchSceneAsync("AppleHillsOverworld", progress);
|
||||
204 await SceneManagerService.Instance.SwitchSceneAsync("Quarry", progress);
|
||||
207 await SceneManagerService.Instance.SwitchSceneAsync("DivingForPictures", progress);
|
||||
7
Assets/Scripts/found_instances.meta
Normal file
7
Assets/Scripts/found_instances.meta
Normal file
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: faea13914b0c70740accf1eeb03f11aa
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user