コード例 #1
0
 private void OnUnitKilled(GameUnit gameUnit)
 {
     if (gameUnit.GetTeam() != 0)
     {
         // Increase the player's score.
         GameLogicMgr gameLogicMgr = GameLogicMgr.GetInstance();
         gameLogicMgr.Score += 1;
     }
 }
コード例 #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();
            }
        }
コード例 #3
0
 public void OnQuitBtn()
 {
     GameLogicMgr.GetInstance().GameOver();
 }
コード例 #4
0
 // Use this for initialization
 void Start()
 {
     _scoreDispTxt = gameObject.GetComponent <Text>();
     _gameLogicMgr = GameLogicMgr.GetInstance();
 }