Exemple #1
0
 protected override BehaviourState RunUpdate()
 {
     // Take food from the source!
     if (target.predator)
     {
         Animal hunted = target.target as Animal;
         hunted.Killed(target);
         target.timesEaten++;
         target.hunger = 0;
         return(BehaviourState.Completed);
     }
     else
     {
         Carrot source = target.target as Carrot;
         target.hunger = 0;
         source.Die();
         target.timesEaten++;
         return(BehaviourState.Completed);
     }
 }