예제 #1
0
 public void Exit()
 {
     animal.ExitBusy();
     water.StopEating(animal);
     animal.RestoreAgentState(ref agent);
     // Debug.Log(animal.name + " stopped eating");
 }
예제 #2
0
    public void Execute()
    {
        animal.UpdateEnergyLevel(Time.deltaTime * 2f);
        if (anim != null)
        {
            anim.Play(animationStr);
        }

        if (animal.GetEnergyLevel() >= 80f)
        {
            // No need to rest
            animal.ExitBusy();
            //animal.GetStateMachine().SwtichToPreviousState();
            animal.GetStateMachine().ChangeState(new WanderAround(agent, animal.GetSpeed(), animal));
        }
    }
예제 #3
0
 public void Exit()
 {
     animal.ExitBusy();
     food.StopEating(animal);
     // animal.RestoreAgentState(ref agent);
 }