// Use this for initialization void Start() { instance = this; _announcer = anounce; DisplayAnnounce("GO!"); InvokeRepeating("SendWeapon", 5.0f, weaponsInterval); InvokeRepeating("SendBonus", 3.0f, bonusInterval); players = gameObject.GetComponentsInChildren <PlayerRobot> (); playersAlive = players.Length; bonusManager = gameObject.GetComponentInChildren <Bonus> (); weaponTrigger = gameObject.GetComponentInChildren <WeaponTrigger> (); bonusTrigger = gameObject.GetComponentInChildren <BonusTrigger> (); }
void Start() { currentArea = gameObject.transform.GetChild(0).GetComponent <Image>(); for (int i = SKIP_OBJECTS; i < WEAPONS_COUNT + SKIP_OBJECTS; i++) { weaponsText[i - SKIP_OBJECTS] = gameObject.transform.GetChild(i).GetComponentInChildren <Text>(); weaponsImage[i - SKIP_OBJECTS] = gameObject.transform.GetChild(i).GetComponentInChildren <Image>(); weaponsImage[i - SKIP_OBJECTS].enabled = false; weaponsText[i - SKIP_OBJECTS].text = ""; WeaponSlot click = weaponsText[i - SKIP_OBJECTS].gameObject.AddComponent <WeaponSlot>(); click.Setup(this, i - SKIP_OBJECTS); } activeImage = transform.GetChild(ACTIVE_INDEX).GetComponentInChildren <Image>(); activeText = transform.GetChild(ACTIVE_INDEX).GetComponentInChildren <Text>(); activeImage.enabled = false; activeText.text = ""; trigger = transform.GetChild(ACTIVE_INDEX).gameObject.AddComponent <WeaponTrigger>(); }