This commit is contained in:
ThomasCharester committed 2026-05-04 12:45:12 +03:00
1 parent e1a474d4ac
commit 24b1157026
164 files changed
+68527

No files matched your search

@@ -0,0 +1,49 @@
using UnityEngine;
namespace Code.GameplayServices
{
public class GameplayManager : MonoBehaviour
{
public static GameplayManager Instance { get; private set; }
private bool _onPause;
public bool OnPause => _onPause;
[SerializeField] [Range(0f, 30f)] private float gameSpeed;
private float _currentGameSpeed;
public float GameSpeed => _currentGameSpeed;
private void Awake()
{
Instance = this;
_currentGameSpeed = gameSpeed;
}
public void RestartGame()
{
ResetGame();
ResumeGame();
}
public void PlayerDead()
{
PauseGame();
}
public void PauseGame()
{
_onPause = true;
_currentGameSpeed = 0f;
}
public void ResumeGame()
{
_onPause = false;
_currentGameSpeed = gameSpeed;
}
private void ResetGame()
{
PassingObjectsManager.Instance.ResetObjects();
PlayerScoreService.Instance.ResetScore();
}
}
}