コード例 #1
0
        public void Start()
        {
            // cache for quick lookup
            gameManager = RTSGameManager.instance;

            // increase the OnGUI font size
            labelStyle = new GUIStyle();
            labelStyle.fontSize = 24;
            labelStyle.normal.textColor = Color.white;

            // keep a reference to all of the enemy building health components so the gui can display how much enemy health is left
            var enemyBuildings = FindObjectsOfType(typeof(EnemyBuilding)) as EnemyBuilding[];
            for (int i = 0; i < enemyBuildings.Length; ++i) {
                enemyHealth.Add(enemyBuildings[i].GetComponent<Health>());
                startEnemyHealth += enemyHealth[i].startHealth;
            }
        }
コード例 #2
0
ファイル: RTSGUIController.cs プロジェクト: gonzsa04/IA
        public void Start()
        {
            // cache for quick lookup
            gameManager = RTSGameManager.instance;

            // increase the OnGUI font size
            labelStyle                  = new GUIStyle();
            labelStyle.fontSize         = 24;
            labelStyle.normal.textColor = Color.white;

            // keep a reference to all of the enemy building health components so the gui can display how much enemy health is left
            var enemyBuildings = FindObjectsOfType(typeof(EnemyBuilding)) as EnemyBuilding[];

            for (int i = 0; i < enemyBuildings.Length; ++i)
            {
                enemyHealth.Add(enemyBuildings[i].GetComponent <Health>());
                startEnemyHealth += enemyHealth[i].startHealth;
            }
        }
コード例 #3
0
 public override void OnAwake()
 {
     // cache for quick lookup
     harvester   = gameObject.GetComponent <Harvester>();
     gameManager = RTSGameManager.instance;
 }
コード例 #4
0
 public void Awake()
 {
     instance = this;
 }
コード例 #5
0
ファイル: UnloadGold.cs プロジェクト: JohnnyVox/schoolfire
 public override void OnAwake()
 {
     // cache for quick lookup
     harvester = gameObject.GetComponent<Harvester>();
     gameManager = RTSGameManager.instance;
 }
コード例 #6
0
 public void Awake()
 {
     instance = this;
 }