Revamp the prompt system, the bootstrapper system, the starting cinematic
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -3,6 +3,7 @@ using Core;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Input;
|
||||
using Bootstrap;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
@@ -11,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;
|
||||
@@ -43,18 +31,30 @@ namespace UI
|
||||
/// </summary>
|
||||
public bool IsPaused => _isPaused;
|
||||
|
||||
private void Start()
|
||||
private void Awake()
|
||||
{
|
||||
_instance = this;
|
||||
|
||||
// Register for post-boot initialization
|
||||
BootCompletionService.RegisterInitAction(InitializePostBoot);
|
||||
}
|
||||
|
||||
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
|
||||
#endif
|
||||
|
||||
Logging.Debug("[PauseMenu] Subscribed to SceneManagerService events");
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
@@ -81,9 +81,11 @@ namespace UI
|
||||
return;
|
||||
|
||||
bool isMainMenu = levelName.ToLower().Contains("mainmenu");
|
||||
gameObject.SetActive(!isMainMenu);
|
||||
bool isStartingLevel = levelName.ToLower().Contains("startingscene");
|
||||
|
||||
if(!isMainMenu)
|
||||
gameObject.SetActive(!(isMainMenu || isStartingLevel));
|
||||
|
||||
if(!isMainMenu && !isStartingLevel)
|
||||
HidePauseMenu(false); // Ensure menu is hidden when switching to a game level
|
||||
|
||||
Logging.Debug($"[PauseMenu] Setting pause menu active: {!isMainMenu} for scene: {levelName}");
|
||||
|
||||
@@ -42,22 +42,21 @@ public class DivingTutorial : MonoBehaviour, ITouchInputConsumer
|
||||
|
||||
public void OnTap(Vector2 position)
|
||||
{
|
||||
|
||||
stateMachine.Next(true);
|
||||
}
|
||||
|
||||
public void OnHoldStart(Vector2 position)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
return;
|
||||
}
|
||||
|
||||
public void OnHoldMove(Vector2 position)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
return;
|
||||
}
|
||||
|
||||
public void OnHoldEnd(Vector2 position)
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user