Exemplo n.º 1
0
 /// <summary>
 /// 恢复移动. 确保之前是手动暂停过
 /// </summary>
 public void ResumeMove()
 {
     //我们需要确认是之前暂停了, 才能恢复现场
     if (m_status == PathFollowingStatus.Paused)
     {
         m_status = PathFollowingStatus.Moving;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 请求移动
        /// </summary>
        public void RequestMove(CTilePathResult wayPoints, MoveType moveType)
        {
            m_mover.SetMoveType(moveType);
            m_wayPoints = wayPoints;
            m_result    = FinishPathResultType.Default;
            m_status    = PathFollowingStatus.Moving;

            m_pathStepIndex = wayPoints.StartIndex;
            m_currStep      = wayPoints.StartPos;
            GotoNode(m_pathStepIndex);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 外来原因中止移动
        /// </summary>
        public void AbortMove()
        {
            m_result = FinishPathResultType.Aborted;
            m_status = PathFollowingStatus.Idle;

            m_wayPoints = null;
            if (m_onPathFinishedCallBack != null)
            {
                m_onPathFinishedCallBack(FinishPathResultType.Aborted);
                m_onPathFinishedCallBack = null;
            }
        }
Exemplo n.º 4
0
        private void Finish()
        {
            m_status = PathFollowingStatus.Idle;
            m_result = FinishPathResultType.Success;
            //跟随到了终点, 我们就停止了跟随
            m_mover.Stop();
            m_onPathFinishedCallBack?.Invoke(m_result);

            var dest = StepDestinationForNow;

            m_spacial.SetLocalPosInXZ(StepDestinationForNow);
            //Debug.Log("Path Follow Finished! At " + m_spacial.localPosition);

            m_wayPoints = null;
        }
Exemplo n.º 5
0
 /// <summary>
 /// 重置本组件的初始状态
 /// </summary>
 public void ResetFinishResult()
 {
     m_result = FinishPathResultType.Default;
     m_status = PathFollowingStatus.Idle;
 }
Exemplo n.º 6
0
 /// <summary>
 /// 暂停移动, 比如说英雄技能挂起整个战场
 /// </summary>
 public void PauseMove()
 {
     m_status = PathFollowingStatus.Paused;
 }