diff options
author | chai <215380520@qq.com> | 2023-11-26 23:52:30 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-11-26 23:52:30 +0800 |
commit | 626381f061cde0c78564f6336e3131835cf20a5b (patch) | |
tree | d9991d6eda6ae5d7649ac91ecaa3b4dc833cd4c3 /Assembly_CSharp/Waypoint.cs | |
parent | 0e63c4a2c6dec8dfa260501fb7d73750261ea7b7 (diff) |
* move
Diffstat (limited to 'Assembly_CSharp/Waypoint.cs')
-rw-r--r-- | Assembly_CSharp/Waypoint.cs | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/Assembly_CSharp/Waypoint.cs b/Assembly_CSharp/Waypoint.cs deleted file mode 100644 index b250079..0000000 --- a/Assembly_CSharp/Waypoint.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; - -public class Waypoint : MonoBehaviour -{ - [SerializeField] - private Waypoint next; - - [SerializeField] - private List<Waypoint> previous = new List<Waypoint>(); - - public float distanceFromEnd; - - public bool trueDistance; - - private void Start() - { - UpdateDistance(); - } - - public Waypoint GetNextWaypoint() - { - if (next != null) - { - return next; - } - return this; - } - - public void SetNextWaypoint(Waypoint newNext) - { - next = newNext; - } - - public void AddPreviousWaypoint(Waypoint previousWaypoint) - { - previous.Add(previousWaypoint); - } - - public Waypoint[] GetPreviousWaypoints() - { - return previous.ToArray(); - } - - public void UpdateDistance() - { - if (next == null) - { - trueDistance = true; - return; - } - if (!next.trueDistance) - { - next.UpdateDistance(); - } - if (!trueDistance) - { - distanceFromEnd = next.distanceFromEnd + Vector3.Magnitude(next.transform.position - base.transform.position); - trueDistance = true; - } - } -} |