49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
|
|
using UnityEngine;
|
||
|
|
using WarGame.Managers;
|
||
|
|
|
||
|
|
namespace WarGame
|
||
|
|
{
|
||
|
|
public class GameManager : MonoBehaviour
|
||
|
|
{
|
||
|
|
public static GameManager Instance { get; private set; }
|
||
|
|
|
||
|
|
[Header("Manager References")]
|
||
|
|
[SerializeField] private BattleManager battleManager;
|
||
|
|
|
||
|
|
public BattleManager BattleManager => battleManager;
|
||
|
|
|
||
|
|
private void Awake()
|
||
|
|
{
|
||
|
|
if (Instance != null && Instance != this)
|
||
|
|
{
|
||
|
|
Destroy(gameObject);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
Instance = this;
|
||
|
|
|
||
|
|
if (battleManager == null)
|
||
|
|
{
|
||
|
|
battleManager = FindFirstObjectByType<BattleManager>();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private void Start()
|
||
|
|
{
|
||
|
|
Debug.Log("[WarGame] Game initialized successfully. Ready for recruitment!");
|
||
|
|
}
|
||
|
|
|
||
|
|
public void PauseGame(bool pause)
|
||
|
|
{
|
||
|
|
Time.timeScale = pause ? 0f : 1f;
|
||
|
|
}
|
||
|
|
|
||
|
|
public void RestartBattle()
|
||
|
|
{
|
||
|
|
if (battleManager != null)
|
||
|
|
{
|
||
|
|
battleManager.ContinueToNextRound();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|