Esempio n. 1
0
    public static void RequestPath(Vector3 pathStart, Vector3 pathEnd, Action <Vector3[], bool> callback)
    {
        Pathrequest newRequest = new Pathrequest(pathStart, pathEnd, callback);

        instance.pathRequestQueue.Enqueue(newRequest);
        instance.tryNextProcess();
    }
Esempio n. 2
0
 void tryNextProcess()
 {
     if (!processingPath && pathRequestQueue.Count > 0)
     {
         currentPathRequest = pathRequestQueue.Dequeue();
         processingPath     = true;
         pathfinding.startCalculatingPath(currentPathRequest.pathStart, currentPathRequest.pathEnd);     // maybe this needs new locations
     }
 }