mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交
This commit is contained in:
@@ -118,7 +118,7 @@ namespace Pathfinding.Legacy {
|
||||
// gets confused because the first point in the path is far away
|
||||
// from the current position (possibly behind it which could cause
|
||||
// the agent to turn around, and that looks pretty bad).
|
||||
Vector3 p1 = Time.time - lastFoundWaypointTime < 0.3f ? lastFoundWaypointPosition : p.originalStartPoint;
|
||||
Vector3 p1 = GetSync().Time.time - lastFoundWaypointTime < 0.3f ? lastFoundWaypointPosition : p.originalStartPoint;
|
||||
Vector3 p2 = GetFeetPosition();
|
||||
Vector3 dir = p2-p1;
|
||||
float magn = dir.magnitude;
|
||||
@@ -154,7 +154,7 @@ namespace Pathfinding.Legacy {
|
||||
} else if (rigid != null) {
|
||||
rigid.AddForce(dir);
|
||||
} else {
|
||||
tr.Translate(dir*Time.deltaTime, Space.World);
|
||||
tr.Translate(dir*GetSync().Time.deltaTime, Space.World);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace Pathfinding.Legacy {
|
||||
//Mathfx.DistancePointSegmentStrict (vPath[currentWaypointIndex+1],vPath[currentWaypointIndex+2],currentPosition);
|
||||
if (dist < pickNextWaypointDist*pickNextWaypointDist) {
|
||||
lastFoundWaypointPosition = currentPosition;
|
||||
lastFoundWaypointTime = Time.time;
|
||||
lastFoundWaypointTime = GetSync().Time.time;
|
||||
currentWaypointIndex++;
|
||||
} else {
|
||||
break;
|
||||
@@ -245,8 +245,8 @@ namespace Pathfinding.Legacy {
|
||||
Debug.DrawRay(GetFeetPosition(), forward*sp, Color.cyan);
|
||||
#endif
|
||||
|
||||
if (Time.deltaTime > 0) {
|
||||
sp = Mathf.Clamp(sp, 0, targetDist/(Time.deltaTime*2));
|
||||
if (GetSync().Time.deltaTime > 0) {
|
||||
sp = Mathf.Clamp(sp, 0, targetDist/(GetSync().Time.deltaTime*2));
|
||||
}
|
||||
|
||||
return forward*sp;
|
||||
@@ -263,7 +263,7 @@ namespace Pathfinding.Legacy {
|
||||
Quaternion rot = tr.rotation;
|
||||
Quaternion toTarget = Quaternion.LookRotation(dir);
|
||||
|
||||
rot = Quaternion.Slerp(rot, toTarget, turningSpeed*Time.deltaTime);
|
||||
rot = Quaternion.Slerp(rot, toTarget, turningSpeed*GetSync().Time.deltaTime);
|
||||
Vector3 euler = rot.eulerAngles;
|
||||
euler.z = 0;
|
||||
euler.x = 0;
|
||||
|
Reference in New Issue
Block a user