Beispiel #1
0
    /// <summary>
    /// Start flight from source marker to destination.
    /// </summary>
    public void SimulateFlight()
    {
        path = SpaceNavMesh.FindPath(Source.position, Destination.position);

        if (path == null)
        {
            FlightFinished.Invoke();
            return;
        }

        List <Vector3> points = new List <Vector3>(path);

        points.Insert(0, Source.position);
        points.Add(Destination.position);

        path = points.ToArray();

        DroneManager.FlyByPath(path);
    }