From 626381f061cde0c78564f6336e3131835cf20a5b Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Sun, 26 Nov 2023 23:52:30 +0800 Subject: * move --- Assembly_CSharp/Waypoint.cs | 62 --------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 Assembly_CSharp/Waypoint.cs (limited to 'Assembly_CSharp/Waypoint.cs') 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 previous = new List(); - - 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; - } - } -} -- cgit v1.1-26-g67d0