3DTD/Assets/Scripts/Manager/GameManager.cs

24 lines
534 B
C#

using UnityEngine;
public class GameManager : MonoBehaviour
{
public static GameManager Instance;
public bool IsBuildMode = false;
private Tower selectedTower;
public Tower SelectedTower { get { return selectedTower; } set {
if (selectedTower != null)
selectedTower.TowerSelected(false);
selectedTower = value;
selectedTower.TowerSelected(true);
}}
private void Awake()
{
if (Instance != this)
Destroy(Instance);
Instance = this;
}
}