2024-04-20 22:05:01 +02:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class GameManager : MonoBehaviour
|
|
|
|
{
|
|
|
|
public static GameManager Instance;
|
|
|
|
|
2024-04-20 22:07:34 +02:00
|
|
|
public bool IsBuildMode = false;
|
2024-04-20 22:42:06 +02:00
|
|
|
private Tower selectedTower;
|
|
|
|
public Tower SelectedTower { get { return selectedTower; } set {
|
|
|
|
if (selectedTower != null)
|
|
|
|
selectedTower.TowerSelected(false);
|
|
|
|
|
|
|
|
selectedTower = value;
|
|
|
|
selectedTower.TowerSelected(true);
|
|
|
|
Debug.Log($"Selected: {selectedTower}");
|
|
|
|
}}
|
2024-04-20 22:07:34 +02:00
|
|
|
|
2024-04-20 22:20:20 +02:00
|
|
|
private void Awake()
|
2024-04-20 22:05:01 +02:00
|
|
|
{
|
|
|
|
if (Instance != this)
|
|
|
|
Destroy(Instance);
|
|
|
|
Instance = this;
|
|
|
|
}
|
|
|
|
}
|