Working pause menu re-worked with exlusive views

This commit is contained in:
Michal Pikulski
2025-10-24 10:41:27 +02:00
parent 7bb905eb6b
commit 1003c3f6ac
14 changed files with 878 additions and 116 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using AppleHills.Core.Interfaces;
using AppleHills.Core.Settings;
using Bootstrap;
using Input;
using UnityEngine;
namespace Core
@@ -122,9 +123,9 @@ namespace Core
/// <param name="shouldPause">True to pause; false to resume</param>
private void ApplyPause(bool shouldPause)
{
// Example: stop time
Time.timeScale = shouldPause ? 0f : 1f;
// TODO: Do we want to stop time?
// Time.timeScale = shouldPause ? 0f : 1f;
// Notify registered components
foreach (var component in _pausableComponents)
{
@@ -136,10 +137,18 @@ namespace Core
// Fire events
if (shouldPause)
{
// TODO: Stop input here?
InputManager.Instance.SetInputMode(InputMode.UI);
OnGamePaused?.Invoke();
}
else
{
// TODO: Release input here?
InputManager.Instance.SetInputMode(InputMode.GameAndUI);
OnGameResumed?.Invoke();
}
Logging.Debug($"[GameManager] Game {(shouldPause ? "paused" : "resumed")}. Paused {_pausableComponents.Count} components.");
}