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); } }
void OnTriggerEnter(Collider collider) { if (collider.gameObject.tag == "Playermob") { MinionStatus m = collider.gameObject.GetComponent <MinionStatus>(); Damages(m.ATK); } }
// Use this for initialization void Start() { GameObject objstatus = gameObject.transform.parent.gameObject; status = objstatus.GetComponent <MinionStatus>(); }