void CollectCoin() { if (GameManagerPackMan.coins[CellPosition.YCoordinate, CellPosition.XCoordinate] != null) { GameManagerPackMan.coins[CellPosition.YCoordinate, CellPosition.XCoordinate].PickupDot(); // GameManagerPackMan.coins[CellPosition.YCoordinate, CellPosition.XCoordinate] = null; GameManagerPackMan.coinsTotal -= 1; score += 10; WIN = GameManagerPackMan.HasWon(); } }
private void Start() { gameManager = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManagerPackMan>(); }