public void notifyNPC() { FightFlight ff = GetComponent <FightFlight>(); if (ff != null) { ff.gotHit(); } }
private void OnTriggerStay(Collider other) { if (other.tag.Equals("OwnedNPC")) { FightFlight ff = other.GetComponent <FightFlight>(); if (ff != null) { if (ff.isFleeing()) { beginToShelterNPC(other.gameObject); } } } else if (other.tag.Equals("ProtectedNPC")) { Guard g = other.GetComponent <Guard>(); if (g.enabled) { FightFlight ff = other.GetComponent <FightFlight>(); ff.revert(); resetShelteredNPC(other.gameObject); } } }