| | |
| | | {
|
| | | Vector3 _curPos = Pos;
|
| | | _curPos.y = 0;
|
| | | Debug.LogFormat("6666666 想要切换至目标npc: {0} {1}", position, m_Path);
|
| | |
|
| | | try
|
| | | if (NavMesh.CalculatePath(_curPos, position, NavMesh.AllAreas, m_Path))
|
| | | {
|
| | | if (NavMesh.CalculatePath(_curPos, position, NavMesh.AllAreas, m_Path))
|
| | | m_CornerIndex = 0;
|
| | | m_KeepDist = keepDist;
|
| | | PathFindStatus = E_PathFindStatus.Moving;
|
| | | if (OnPathFindStart != null)
|
| | | {
|
| | | m_CornerIndex = 0;
|
| | | m_KeepDist = keepDist;
|
| | | PathFindStatus = E_PathFindStatus.Moving;
|
| | | if (OnPathFindStart != null)
|
| | | {
|
| | | OnPathFindStart();
|
| | | }
|
| | | Run();
|
| | | State = E_ActorState.AutoRun;
|
| | | Debug.LogFormat("77777777 想要切换至目标npc: {0}", position);
|
| | | // if (this is GActorNpcFight
|
| | | // && (ServerInstID == 133 || ServerInstID == 134 || ServerInstID == 112))
|
| | | // {
|
| | | // Debug.LogFormat("{0} 开始寻路至点: {1}", ServerInstID, position);
|
| | | // }
|
| | | OnPathFindStart();
|
| | | }
|
| | | }
|
| | | catch (System.Exception e)
|
| | | {
|
| | | Debug.LogError("NavMeshPath error: " + e.Message);
|
| | | return;
|
| | | }
|
| | | Run();
|
| | | State = E_ActorState.AutoRun;
|
| | |
|
| | | // if (this is GActorNpcFight
|
| | | // && (ServerInstID == 133 || ServerInstID == 134 || ServerInstID == 112))
|
| | | // {
|
| | | // Debug.LogFormat("{0} 开始寻路至点: {1}", ServerInstID, position);
|
| | | // }
|
| | | }
|
| | | }
|
| | |
|
| | | public static bool TryGetValidPos(Vector3 position, ref Vector3 validPosition)
|