示例#1
0
 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>();
 }
示例#3
0
 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>();
 }
示例#4
0
    // 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>();
        }
    }