Esempio n. 1
0
        protected override CommandReplyType CheckRunTo(AutoMoveCommand cmd)
        {
            if (m_Vehicle.GetActorPathFinding().CanReachPosition(cmd.DestPosition) == false)
            {
                ShowWarning("300001");
                return(CommandReplyType.NO);
            }

            return(base.CheckRunTo(cmd));
        }
Esempio n. 2
0
 public override void OnPursue(AutoMoveCommand ev)
 {
     if (m_Vehicle != null && m_Vehicle != this)
     {
         m_Vehicle.OnPursue(ev);
         m_AnimController.Play("qicheng_run", null, true);
     }
     else
     {
         base.OnPursue(ev);
     }
 }
Esempio n. 3
0
        protected override void OnEnter(IFsm <ActorBase> fsm)
        {
            base.OnEnter(fsm);

            if (m_Command is AutoMoveCommand)
            {
                AutoMoveCommand autoMove = m_Command as AutoMoveCommand;
                m_Owner.OnPursue(autoMove);
            }
            else
            {
                MoveCommand move = m_Command as MoveCommand;
                m_Owner.OnForceToMove(move);
            }
        }
 /// <summary>
 /// 自动寻路
 /// </summary>
 public virtual void OnPursue(AutoMoveCommand ev)
 {
     this.m_ActorPathFinding.SetOnFinished(ev.Callback);
     MoveTo(ev.DestPosition);
     this.m_AnimController.Play("run", null, true);
 }