示例#1
0
        public override void Execute(BasicAgent agent)
        {
            //if (!agent.isSafe())
            //    agent.ChangeState(new State_Bond());
            //else
            agent.Patrol();

            //base.Execute(agent);
        }
示例#2
0
        public override void Execute(BasicAgent agent)
        {
            if (!agent.isSafe())
            {
                agent.ChangeState(new State_Seek());
            }
            else
            {
                agent.Patrol();
            }

            base.Execute(agent);
        }
示例#3
0
        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);
        }
示例#4
0
 /// <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)
 {
 }
示例#5
0
 /// <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)
 {
 }
示例#6
0
 /// <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)
 {
 }