Exemplo 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.tryProcessNext ();
    }
Exemplo n.º 2
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.tryprocessnext();
    }
Exemplo n.º 3
0
 void tryProcessNext()
 {
     if (!isProcessingPath && pathRequestQueue.Count > 0)
     {
         currentPathRequest = pathRequestQueue.Dequeue();
         isProcessingPath = true;
         mainPathfinding.startFindPath(currentPathRequest.pathStart, currentPathRequest.pathEnd);
     }
 }
Exemplo n.º 4
0
 private void tryprocessnext()
 {
     // throw new NotImplementedException();
     if (!isprocessingpath && pathRequestQueue.Count > 0)
     {
         isprocessingpath   = true;
         currentpathrequest = pathRequestQueue.Dequeue();
         pathFinding.startFindPath(currentpathrequest.pathStart, currentpathrequest.pathEnd);
     }
 }