private void OnUnitKilled(GameUnit gameUnit) { if (gameUnit.GetTeam() != 0) { // Increase the player's score. GameLogicMgr gameLogicMgr = GameLogicMgr.GetInstance(); gameLogicMgr.Score += 1; } }
private void OnBuildingDestroyed(GameBuilding destroyedBuilding) { GameLogicMgr gameLogicMgr = GameLogicMgr.GetInstance(); if (destroyedBuilding.GetTeam() != 0) { // Display you won message. gameLogicMgr.GameWon(); } else { // Display the you lost message. gameLogicMgr.GameOver(); } }
// Use this for initialization void Start () { _coinCountDisplay = gameObject.GetComponent<UnityEngine.UI.Text>(); _gameLogicMgr = GameObject.FindGameObjectWithTag("GameMgr").GetComponent<GameLogicMgr>(); }
public void OnQuitBtn() { GameLogicMgr.GetInstance().GameOver(); }
// Use this for initialization void Start () { _scoreDispTxt = gameObject.GetComponent<Text>(); _gameLogicMgr = GameLogicMgr.GetInstance(); }
// Use this for initialization void Start() { _scoreDispTxt = gameObject.GetComponent <Text>(); _gameLogicMgr = GameLogicMgr.GetInstance(); }
// Use this for initialization void Start() { _coinCountDisplay = gameObject.GetComponent <UnityEngine.UI.Text>(); _gameLogicMgr = GameObject.FindGameObjectWithTag("GameMgr").GetComponent <GameLogicMgr>(); }