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; } }
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; } }
public override void OnAwake() { // cache for quick lookup harvester = gameObject.GetComponent <Harvester>(); gameManager = RTSGameManager.instance; }
public void Awake() { instance = this; }
public override void OnAwake() { // cache for quick lookup harvester = gameObject.GetComponent<Harvester>(); gameManager = RTSGameManager.instance; }