Exemple #1
0
 private void OnUnitKilled(GameUnit gameUnit)
 {
     if (gameUnit.GetTeam() != 0)
     {
         // Increase the player's score.
         GameLogicMgr gameLogicMgr = GameLogicMgr.GetInstance();
         gameLogicMgr.Score += 1;
     }
 }
Exemple #2
0
        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>();
	}
Exemple #4
0
 public void OnQuitBtn()
 {
     GameLogicMgr.GetInstance().GameOver();
 }
Exemple #5
0
	// Use this for initialization
	void Start ()
    {
        _scoreDispTxt = gameObject.GetComponent<Text>();
        _gameLogicMgr = GameLogicMgr.GetInstance();
    }
Exemple #6
0
 // Use this for initialization
 void Start()
 {
     _scoreDispTxt = gameObject.GetComponent <Text>();
     _gameLogicMgr = GameLogicMgr.GetInstance();
 }
Exemple #7
0
 // Use this for initialization
 void Start()
 {
     _coinCountDisplay = gameObject.GetComponent <UnityEngine.UI.Text>();
     _gameLogicMgr     = GameObject.FindGameObjectWithTag("GameMgr").GetComponent <GameLogicMgr>();
 }