From d2c6c5df38a29ebf4157c5b161d0130231fc8a64 Mon Sep 17 00:00:00 2001 From: Michal Pikulski Date: Thu, 16 Oct 2025 16:18:04 +0200 Subject: [PATCH] stash work --- .../Scripts/Bootstrap/BootSceneController.cs | 27 +-- .../Scripts/Cinematics/CinematicsManager.cs | 34 ++- Assets/Scripts/Cinematics/SkipCinematic.cs | 17 -- Assets/Scripts/Core/GameManager.cs | 25 +-- Assets/Scripts/Core/ItemManager.cs | 26 +-- Assets/Scripts/Core/QuickAccess.cs | 24 +- Assets/Scripts/Core/SceneManagerService.cs | 26 +-- .../Scripts/Core/SceneOrientationEnforcer.cs | 40 ++-- .../Developer/DeveloperSettingsProvider.cs | 4 +- .../Data/CardSystem/CardSystemManager.cs | 10 + Assets/Scripts/Input/InputManager.cs | 62 ++---- Assets/Scripts/PuzzleS/PuzzleManager.cs | 39 +--- .../Settings/SceneOrientationConfig.cs | 2 +- .../Settings/ScreenOrientationRequirement.cs | 3 +- .../Scripts/UI/CardSystem/UIPageController.cs | 10 + Assets/Scripts/UI/LoadingScreenController.cs | 30 ++- Assets/Scripts/UI/PauseMenu.cs | 37 +--- Assets/Scripts/found_instances | 207 ++++++++++++++++++ Assets/Scripts/found_instances.meta | 7 + 19 files changed, 353 insertions(+), 277 deletions(-) create mode 100644 Assets/Scripts/found_instances create mode 100644 Assets/Scripts/found_instances.meta diff --git a/Assets/Scripts/Bootstrap/BootSceneController.cs b/Assets/Scripts/Bootstrap/BootSceneController.cs index d2877526..eba66b8b 100644 --- a/Assets/Scripts/Bootstrap/BootSceneController.cs +++ b/Assets/Scripts/Bootstrap/BootSceneController.cs @@ -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; - 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(); - } + // Subscribe to boot progress events + CustomBoot.OnBootProgressChanged += OnBootProgressChanged; + + // 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) diff --git a/Assets/Scripts/Cinematics/CinematicsManager.cs b/Assets/Scripts/Cinematics/CinematicsManager.cs index 0fcbefd1..66eafa0f 100644 --- a/Assets/Scripts/Cinematics/CinematicsManager.cs +++ b/Assets/Scripts/Cinematics/CinematicsManager.cs @@ -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> _addressableHandles = new Dictionary>(); - public static CinematicsManager Instance - { - get - { - if (_instance == null && Application.isPlaying && !_isQuitting) - { - _instance = FindAnyObjectByType(); - if (_instance == null) - { - var go = new GameObject("CinematicsManager"); - _instance = go.AddComponent(); - // DontDestroyOnLoad(go); - } - } - return _instance; - } - } + /// + /// Singleton instance of the CinematicsManager. No longer creates an instance if one doesn't exist. + /// + 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() diff --git a/Assets/Scripts/Cinematics/SkipCinematic.cs b/Assets/Scripts/Cinematics/SkipCinematic.cs index 44094cca..7db5ecf1 100644 --- a/Assets/Scripts/Cinematics/SkipCinematic.cs +++ b/Assets/Scripts/Cinematics/SkipCinematic.cs @@ -31,23 +31,6 @@ namespace Cinematics radialProgressBar.fillAmount = 0f; } } - - 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() { diff --git a/Assets/Scripts/Core/GameManager.cs b/Assets/Scripts/Core/GameManager.cs index ba930a48..daf66e07 100644 --- a/Assets/Scripts/Core/GameManager.cs +++ b/Assets/Scripts/Core/GameManager.cs @@ -16,25 +16,9 @@ public class GameManager : MonoBehaviour private static bool _isQuitting = false; /// - /// Singleton instance of the GameManager. + /// Singleton instance of the GameManager. No longer creates an instance if one doesn't exist. /// - public static GameManager Instance - { - get - { - if (_instance == null && Application.isPlaying && !_isQuitting) - { - _instance = FindAnyObjectByType(); - if (_instance == null) - { - var go = new GameObject("GameManager"); - _instance = go.AddComponent(); - // 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 diff --git a/Assets/Scripts/Core/ItemManager.cs b/Assets/Scripts/Core/ItemManager.cs index 6306f14d..fab7930b 100644 --- a/Assets/Scripts/Core/ItemManager.cs +++ b/Assets/Scripts/Core/ItemManager.cs @@ -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(); - if (_instance == null) - { - var go = new GameObject("ItemManager"); - _instance = go.AddComponent(); - // DontDestroyOnLoad(go); - } - } - return _instance; - } - } + /// + /// Singleton instance of the ItemManager. No longer creates an instance if one doesn't exist. + /// + public static ItemManager Instance => _instance; private readonly HashSet _pickups = new HashSet(); private readonly HashSet _itemSlots = new HashSet(); @@ -68,11 +55,6 @@ namespace Core // Register for post-boot initialization BootCompletionService.RegisterInitAction(InitializePostBoot); } - - void Start() - { - // SceneManagerService subscription moved to InitializePostBoot - } private void InitializePostBoot() { diff --git a/Assets/Scripts/Core/QuickAccess.cs b/Assets/Scripts/Core/QuickAccess.cs index 954860c7..944e6217 100644 --- a/Assets/Scripts/Core/QuickAccess.cs +++ b/Assets/Scripts/Core/QuickAccess.cs @@ -18,23 +18,11 @@ 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(); - if (_instance == null) - { - var go = new GameObject("QuickAccess"); - _instance = go.AddComponent(); - } - } - return _instance; - } - } - + /// + /// Singleton instance of QuickAccess. No longer creates an instance if one doesn't exist. + /// + public static QuickAccess Instance => _instance; + void OnApplicationQuit() { _isQuitting = true; @@ -146,6 +134,8 @@ namespace AppleHills.Core private void Awake() { + _instance = this; + if (!_initialized) { // Subscribe to scene changes diff --git a/Assets/Scripts/Core/SceneManagerService.cs b/Assets/Scripts/Core/SceneManagerService.cs index c97ceda9..0244d624 100644 --- a/Assets/Scripts/Core/SceneManagerService.cs +++ b/Assets/Scripts/Core/SceneManagerService.cs @@ -16,26 +16,11 @@ namespace Core private LoadingScreenController _loadingScreen; private static SceneManagerService _instance; private static bool _isQuitting = false; + /// - /// Singleton instance of the SceneManagerService. + /// Singleton instance of the SceneManagerService. No longer creates an instance if one doesn't exist. /// - public static SceneManagerService Instance - { - get - { - if (_instance == null && Application.isPlaying && !_isQuitting) - { - _instance = FindAnyObjectByType(); - if (_instance == null) - { - var go = new GameObject("SceneManagerService"); - _instance = go.AddComponent(); - // DontDestroyOnLoad(go); - } - } - return _instance; - } - } + public static SceneManagerService Instance => _instance; // Events for scene lifecycle public event Action 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 diff --git a/Assets/Scripts/Core/SceneOrientationEnforcer.cs b/Assets/Scripts/Core/SceneOrientationEnforcer.cs index ca5c8b0c..7ab784ff 100644 --- a/Assets/Scripts/Core/SceneOrientationEnforcer.cs +++ b/Assets/Scripts/Core/SceneOrientationEnforcer.cs @@ -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(); - if (_instance == null) - { - var go = new GameObject("SceneOrientationEnforcer"); - _instance = go.AddComponent(); - // DontDestroyOnLoad(go); // Uncomment if you want persistence - } - } - return _instance; - } - } + + /// + /// Singleton instance of the SceneOrientationEnforcer. No longer creates an instance if one doesn't exist. + /// + 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() diff --git a/Assets/Scripts/Core/Settings/Developer/DeveloperSettingsProvider.cs b/Assets/Scripts/Core/Settings/Developer/DeveloperSettingsProvider.cs index 7b491909..2db54849 100644 --- a/Assets/Scripts/Core/Settings/Developer/DeveloperSettingsProvider.cs +++ b/Assets/Scripts/Core/Settings/Developer/DeveloperSettingsProvider.cs @@ -24,7 +24,7 @@ namespace AppleHills.Core.Settings if (_instance == null && Application.isPlaying) { _instance = FindFirstObjectByType(); - + if (_instance == null) { GameObject go = new GameObject("DeveloperSettingsProvider"); @@ -33,7 +33,7 @@ namespace AppleHills.Core.Settings DontDestroyOnLoad(go); } } - + return _instance; } } diff --git a/Assets/Scripts/Data/CardSystem/CardSystemManager.cs b/Assets/Scripts/Data/CardSystem/CardSystemManager.cs index f2027b21..b8ec90e6 100644 --- a/Assets/Scripts/Data/CardSystem/CardSystemManager.cs +++ b/Assets/Scripts/Data/CardSystem/CardSystemManager.cs @@ -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() diff --git a/Assets/Scripts/Input/InputManager.cs b/Assets/Scripts/Input/InputManager.cs index 2831557e..1cd117d3 100644 --- a/Assets/Scripts/Input/InputManager.cs +++ b/Assets/Scripts/Input/InputManager.cs @@ -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(); - if (_instance == null) - { - var go = new GameObject("InputManager"); - _instance = go.AddComponent(); - } - } - return _instance; - } - } + /// + /// Singleton instance of the InputManager. No longer creates an instance if one doesn't exist. + /// + 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(); @@ -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); - } - - private void Start() - { - // SceneManagerService subscription moved to InitializePostBoot + if (tapMoveAction != null) + tapMoveAction.performed += OnTapMovePerformed; + if (holdMoveAction != null) + { + holdMoveAction.performed += OnHoldMoveStarted; + holdMoveAction.canceled += OnHoldMoveCanceled; + } + 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"); } @@ -140,17 +133,6 @@ namespace Input break; } } - - void OnEnable() - { - if (tapMoveAction != null) - tapMoveAction.performed += OnTapMovePerformed; - if (holdMoveAction != null) - { - holdMoveAction.performed += OnHoldMoveStarted; - holdMoveAction.canceled += OnHoldMoveCanceled; - } - } void OnDisable() { diff --git a/Assets/Scripts/PuzzleS/PuzzleManager.cs b/Assets/Scripts/PuzzleS/PuzzleManager.cs index 91a87461..59957bd0 100644 --- a/Assets/Scripts/PuzzleS/PuzzleManager.cs +++ b/Assets/Scripts/PuzzleS/PuzzleManager.cs @@ -36,25 +36,9 @@ namespace PuzzleS private bool _isLoadingLevelData = false; /// - /// Singleton instance of the PuzzleManager. + /// Singleton instance of the PuzzleManager. No longer creates an instance if one doesn't exist. /// - public static PuzzleManager Instance - { - get - { - if (_instance == null && Application.isPlaying && !_isQuitting) - { - _instance = FindAnyObjectByType(); - if (_instance == null) - { - var go = new GameObject("PuzzleManager"); - _instance = go.AddComponent(); - // DontDestroyOnLoad(go); - } - } - return _instance; - } - } + public static PuzzleManager Instance => _instance; // Events to notify about step lifecycle public event Action OnStepCompleted; @@ -70,7 +54,6 @@ namespace PuzzleS void Awake() { _instance = this; - // DontDestroyOnLoad(gameObject); // Initialize settings reference _interactionSettings = GameManager.GetSettingsObject(); @@ -78,16 +61,11 @@ namespace PuzzleS // Register for post-boot initialization BootCompletionService.RegisterInitAction(InitializePostBoot); } - - void OnEnable() - { - // Subscribe to scene manager events - - } - void Start() + private void InitializePostBoot() { - // 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"); } diff --git a/Assets/Scripts/Settings/SceneOrientationConfig.cs b/Assets/Scripts/Settings/SceneOrientationConfig.cs index fe92171c..34c76e11 100644 --- a/Assets/Scripts/Settings/SceneOrientationConfig.cs +++ b/Assets/Scripts/Settings/SceneOrientationConfig.cs @@ -23,7 +23,7 @@ namespace Settings return entry.requiredOrientation; } // Default to Portrait if not found - return ScreenOrientationRequirement.Portrait; + return ScreenOrientationRequirement.NotApplicable; } } } diff --git a/Assets/Scripts/Settings/ScreenOrientationRequirement.cs b/Assets/Scripts/Settings/ScreenOrientationRequirement.cs index d91adc13..60a52f01 100644 --- a/Assets/Scripts/Settings/ScreenOrientationRequirement.cs +++ b/Assets/Scripts/Settings/ScreenOrientationRequirement.cs @@ -3,7 +3,8 @@ public enum ScreenOrientationRequirement { Portrait, - Landscape + Landscape, + NotApplicable } } diff --git a/Assets/Scripts/UI/CardSystem/UIPageController.cs b/Assets/Scripts/UI/CardSystem/UIPageController.cs index 0d6c96ff..b9f4a220 100644 --- a/Assets/Scripts/UI/CardSystem/UIPageController.cs +++ b/Assets/Scripts/UI/CardSystem/UIPageController.cs @@ -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"); } /// diff --git a/Assets/Scripts/UI/LoadingScreenController.cs b/Assets/Scripts/UI/LoadingScreenController.cs index e902b7f7..045c9c23 100644 --- a/Assets/Scripts/UI/LoadingScreenController.cs +++ b/Assets/Scripts/UI/LoadingScreenController.cs @@ -1,5 +1,6 @@ using System.Collections; using System; +using Bootstrap; using UnityEngine; using UnityEngine.UI; using Core; @@ -48,22 +49,10 @@ namespace UI /// public bool IsActive => loadingScreenContainer != null && loadingScreenContainer.activeSelf; - public static LoadingScreenController Instance - { - get - { - if (_instance == null && Application.isPlaying && !_isQuitting) - { - _instance = FindAnyObjectByType(); - if (_instance == null) - { - var go = new GameObject("LoadingScreenController"); - _instance = go.AddComponent(); - } - } - return _instance; - } - } + /// + /// Singleton instance of the LoadingScreenController. No longer creates an instance if one doesn't exist. + /// + 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"); } /// diff --git a/Assets/Scripts/UI/PauseMenu.cs b/Assets/Scripts/UI/PauseMenu.cs index 9dc5fa81..55f132e0 100644 --- a/Assets/Scripts/UI/PauseMenu.cs +++ b/Assets/Scripts/UI/PauseMenu.cs @@ -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(); - if (_instance == null) - { - var go = new GameObject("PauseMenu"); - _instance = go.AddComponent(); - // DontDestroyOnLoad(go); - } - } - return _instance; - } - } + /// + /// Singleton instance of the PauseMenu. No longer creates an instance if one doesn't exist. + /// + public static PauseMenu Instance => _instance; [Header("UI References")] [SerializeField] private GameObject pauseMenuPanel; @@ -52,23 +39,21 @@ 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 SetPauseMenuByLevel(SceneManager.GetActiveScene().name); - #if UNITY_EDITOR +#if UNITY_EDITOR // Initialize pause menu state HidePauseMenu(false); - #endif - } - - private void InitializePostBoot() - { - // Subscribe to scene loaded events - SceneManagerService.Instance.SceneLoadCompleted += SetPauseMenuByLevel; +#endif + Logging.Debug("[PauseMenu] Subscribed to SceneManagerService events"); } diff --git a/Assets/Scripts/found_instances b/Assets/Scripts/found_instances new file mode 100644 index 00000000..8dca3309 --- /dev/null +++ b/Assets/Scripts/found_instances @@ -0,0 +1,207 @@ +Targets + Occurrences of '.Instance' in Directory C:\Users\info\Desktop\repos\AppleHillsProduction\Assets\Scripts +Found usages (163 usages found) + (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(); + 221 var interactionSettings = SettingsProvider.Instance.LoadSettingsSynchronous(); + 222 var minigameSettings = SettingsProvider.Instance.LoadSettingsSynchronous(); + 275 var divingDevSettings = DeveloperSettingsProvider.Instance.GetSettings(); + 318 return DeveloperSettingsProvider.Instance?.GetSettings(); + 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); diff --git a/Assets/Scripts/found_instances.meta b/Assets/Scripts/found_instances.meta new file mode 100644 index 00000000..3fcffc60 --- /dev/null +++ b/Assets/Scripts/found_instances.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: faea13914b0c70740accf1eeb03f11aa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: