Example #1
0
        public void OnSupplyTriggerStay2D(Collider2D other)
        {
            supply sup = other.gameObject.transform.parent.gameObject.GetComponent <supply> ();

            if (sup != null)
            {
                sup.Gather();
            }
        }
Example #2
0
 void OnTriggerStay2D(Collider2D other)
 {
     if (auto)
     {
         if (other.gameObject.tag == "Enemy")
         {
             ZombieAI ai = other.gameObject.GetComponent <ZombieAI>();
             if (ai != null)
             {
                 TryShoot(ai);
             }
         }
         else if (other.gameObject.tag == "Supply")
         {
             supply sup = other.gameObject.GetComponent <supply>();
             if (sup != null)
             {
                 sup.Gather();
             }
         }
     }
 }