void OnTriggerStay(Collider other) { if (other.tag == "alien") { if (!attacking && built) { attacking = true; temp = other.GetComponent <AlienBehavior> (); InvokeRepeating("Attack", .01f, fireRate); } } }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Bullet" || other.gameObject.tag == "Alien") { AlienBehavior alien = other.gameObject.GetComponent <AlienBehavior>(); if (alien != null && !alien.wasHit) { Counter.instance().subtractCount(); } Destroy(other.gameObject); } }
void OnTriggerEnter(Collider other) { temp = other.GetComponent <AlienBehavior> (); enemies.Add(temp); }