Beispiel #1
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.tag == "Tower")
     {
         Destroy(this.gameObject);
         //agent.Stop();
     }
     if (collider.gameObject.tag == "Playermob")
     {
         walk   = false;
         attack = true;
         MinionStatus m = collider.gameObject.GetComponent <MinionStatus>();
         Damages(m.ATK);
         if (m.HP <= 0)
         {
             walk   = true;
             attack = false;
         }
     }
     if (collider.GetComponent <bullet>())
     {
         bullet b = collider.GetComponent <bullet>();
         Damages(b.Damagee);
     }
 }
Beispiel #2
0
 void OnTriggerEnter(Collider collider)
 {
     if (collider.gameObject.tag == "Playermob")
     {
         MinionStatus m = collider.gameObject.GetComponent <MinionStatus>();
         Damages(m.ATK);
     }
 }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        GameObject objstatus = gameObject.transform.parent.gameObject;

        status = objstatus.GetComponent <MinionStatus>();
    }