Working pause menu re-worked with exlusive views
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user