public override void Execute(BasicAgent agent) { //if (!agent.isSafe()) // agent.ChangeState(new State_Bond()); //else agent.Patrol(); //base.Execute(agent); }
public override void Execute(BasicAgent agent) { if (!agent.isSafe()) { agent.ChangeState(new State_Seek()); } else { agent.Patrol(); } base.Execute(agent); }
public override void Execute(BasicAgent agent) { if (agent.isSafe()) { agent.ChangeState(new State_Patrol()); } else { if (agent.runAway()) { agent.ChangeState(new State_Flee()); } else { agent.Chase(); } } base.Execute(agent); }
/// <summary> /// Called when the state is exited. /// </summary> /// <param name="agent">Agent that this state is asociated with</param> public virtual void Exit(BasicAgent agent) { }
/// <summary> /// Called when the state is executed. /// This is where all your AI logic will be called from. /// /// It is important that your interface has the methods you need to access the associated agents /// world object members as you will want to use these fields/properties and/or methods to help /// weight the desisions your AI will take. /// </summary> /// <param name="agent">Agent that this state is asociated with</param> public virtual void Execute(BasicAgent agent) { }
/// <summary> /// Called when the state is entered. /// </summary> /// <param name="agent">Agent that this state is asociated with</param> public virtual void Enter(BasicAgent agent) { }