Ejemplo n.º 1
0
 void OnTriggerStay(Collider other)
 {
     if (other.tag == "alien")
     {
         if (!attacking && built)
         {
             attacking = true;
             temp      = other.GetComponent <AlienBehavior> ();
             InvokeRepeating("Attack", .01f, fireRate);
         }
     }
 }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 3
0
 void OnTriggerEnter(Collider other)
 {
     temp = other.GetComponent <AlienBehavior> ();
     enemies.Add(temp);
 }