Beispiel #1
0
    public void notifyNPC()
    {
        FightFlight ff = GetComponent <FightFlight>();

        if (ff != null)
        {
            ff.gotHit();
        }
    }
Beispiel #2
0
 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);
         }
     }
 }