private void Awake() { if (_instance == null) { _instance = this; } _player = FindObjectOfType <Player>(); UnitKillHandler.UnitKillPointReached += RecordKill; PlayerMover.OnArrival += HandleArrival; PlayerMover.OnFirstMove += HandleStart; }
public virtual void SetupGame() { gameManager = GameManager.Instance; gameManager.LoadMap(initialMapPrefab); gameManager.CreatePlayers(); SetupPlayers(); killTracker = new KillTracker(); scoreTracker = new ScoreTracker(); GameObject canvas = GameObject.Find("Canvas"); timerDisplay = Instantiate(timerDisplayPrefab).GetComponent <TimerDisplay>(); RectTransform timerTransform = timerDisplay.GetComponent <RectTransform>(); timerDisplay.transform.SetParent(canvas.transform); timerDisplay.transform.localScale = Vector2.one; timerTransform.anchoredPosition = new Vector2(0, -40); }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); camera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>(); killTracker = player.GetComponent <KillTracker>(); }
void Awake() { Instance = this; }