| | |
| | | && MathUtility.DistanceSqrtXZ(DestPos, destPos) < 0.01f
|
| | | && !force)
|
| | | {
|
| | | Debug.LogFormat("3333333 想要切换至目标npc: {0}", destPos);
|
| | | Run();
|
| | | return;
|
| | | }
|
| | |
|
| | | DestPos = destPos;
|
| | | Debug.LogFormat("44444444444 想要切换至目标npc: {0}", destPos);
|
| | | Vector3 _validPos = Pos;
|
| | | if (TryGetValidPos(destPos, ref _validPos))
|
| | | {
|
| | | DestPos = _validPos;
|
| | | m_SearchType = E_SearchType.Static;
|
| | | Debug.LogFormat("55555555 想要切换至目标npc: {0}", DestPos);
|
| | | MoveTo(_validPos, keepDist);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | 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))
|
| | | {
|
| | | m_CornerIndex = 0;
|
| | |
| | | }
|
| | | Run();
|
| | | State = E_ActorState.AutoRun;
|
| | |
|
| | | Debug.LogFormat("77777777 想要切换至目标npc: {0}", position);
|
| | | // if (this is GActorNpcFight
|
| | | // && (ServerInstID == 133 || ServerInstID == 134 || ServerInstID == 112))
|
| | | // {
|
| | |
| | | // }
|
| | | }
|
| | | }
|
| | | catch (System.Exception e)
|
| | | {
|
| | | Debug.LogError("NavMeshPath error: " + e.Message);
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public static bool TryGetValidPos(Vector3 position, ref Vector3 validPosition)
|
| | | {
|