void Start() { if (tower == true) { towerHealth = target.GetComponent <TowerHealth> (); } else if (gem == true) { gemHealth = target.GetComponent <Gem> (); } else if (mob == true) { mobHealth = target.GetComponent <MobHealth> (); } }
void Start() { towerHealth = GetComponent <TowerHealth> (); turret.transform.Rotate(0, Random.Range(0, 361), 0); RandomROF(); //ground are 8, air are 9 if (airTower == true) { layerMask = 1 << 9; } else { layerMask = 1 << 8; } StartCoroutine(GetNewTarget()); }