Fixed many things.
This commit is contained in:
@ -52,7 +52,7 @@ public class MovementController : MonoBehaviour
|
||||
{
|
||||
return MapManager.Instance.NavPoints
|
||||
.Where(point =>
|
||||
(_idNavPointDict[PointStartID].Position - point.Position).magnitude < SettingsReader.Instance.GetSettings.MovementDistance)
|
||||
(transform.position - point.Position).magnitude < SettingsReader.Instance.GetSettings.MovementDistance)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
@ -69,15 +69,12 @@ public class MovementController : MonoBehaviour
|
||||
{
|
||||
if (navMeshAgent.isStopped == true) navMeshAgent.isStopped = false;
|
||||
navMeshAgent.SetDestination(_idNavPointDict[PointStartID].Position);
|
||||
PointEndID = PointStartID;
|
||||
PointStartID = -1;
|
||||
(PointEndID, PointStartID) = (PointStartID, PointEndID);
|
||||
}
|
||||
|
||||
public void StopOnPath()
|
||||
{
|
||||
navMeshAgent.isStopped = true;
|
||||
PointStartID = -1;
|
||||
PointEndID = -1;
|
||||
}
|
||||
|
||||
public void ReachedDestination()
|
||||
|
Reference in New Issue
Block a user