void Start() { powerUI = transform.GetChild(0).gameObject; powerText = transform.GetChild(0).GetComponentInChildren <Text>(); if (powerRoom == null) { powerRoom = GameObject.Find("PowerPlantRoom").GetComponentInChildren <RepairZone>(); } }
private void Awake() { audioSource = GetComponent <AudioSource>(); repairZone = transform.GetChild(0).gameObject; repairZoneScript = repairZone.GetComponent <RepairZone>(); repairFluxer = repairCircle.GetComponent <Animator>(); canvas = GameObject.Find("Canvas"); resourceManager = GameObject.Find("DataManager").GetComponent <DataManager>(); }
protected void Start() { repairZone = GetComponentInChildren <RepairZone>(); if (transform.Find("DestrucitonFlames") != null) { destructionFlames = transform.Find("DestrucitonFlames").gameObject; } if (transform.Find("Smoke") != null) { destructionSmoke = transform.Find("Smoke").gameObject; } spriteRenderer = GetComponentInChildren <SpriteRenderer>(); }
// Start is called before the first frame update void Start() { waterUI = transform.GetChild(0).gameObject; metalUI = transform.GetChild(1).gameObject; waterText = transform.GetChild(0).GetComponentInChildren <Text>(); metalText = transform.GetChild(1).GetComponentInChildren <Text>(); if (waterRoom == null) { waterRoom = GameObject.Find("WaterStorage").GetComponentInChildren <RepairZone>(); } if (metalRoom == null) { metalRoom = GameObject.Find("MetalStorage").GetComponentInChildren <RepairZone>(); } }