Beispiel #1
0
    public void TriggerAvailablePathSwitch(bool force = false)
    {
        if (nextSwitcher == null)
        {
            return;
        }

        var nextPath = nextSwitcher.GetNextPath(path, force);

        if (nextPath == null)
        {
            return;
        }

        path = nextPath;
        path.GetClosestPointAndDistanceByPoint(transform.position, out distance);

        nextSwitcher.RotateSwitcher(path, distance);

        pathParent   = path.transform;
        prevPosition = pathParent.position;
        parentDelta  = Vector3.zero;
    }
Beispiel #2
0
 public void UpdateDistance()
 => path.GetClosestPointAndDistanceByPoint(transform.position, out distance);