public void SubmitFindPath(PathRequest _PR, PathFinderManager _PFM, NodeManager _NM) { CurrentStatus = PathfinderStatus.Active; //Debug.Log("PF: Request Recived by Pathfinder!"); CurrentPR = _PR; PFM = _PFM; if (CurrentPR == null) { //Debug.Log("PF: Incompleate Request, Null PR!"); CurrentStatus = PathfinderStatus.Incative; return; } if (CurrentPR.PathIsFound == true) { //Debug.Log("PF: Path Request has already been solved!!"); _PFM.CompleatedRequests.Enqueue(CurrentPR); CurrentStatus = PathfinderStatus.Incative; return; } if (CurrentPR.StartingNode == null || CurrentPR.TargetNode == null || CurrentPR.Requestee == null) { //Debug.Log("PF: Incompleate Request, Null Node/Requetee!"); CurrentStatus = PathfinderStatus.Incative; return; } else if (CurrentPR.IsBeingProcessed == false && CurrentPR.CompletedPath == null) { CurrentNM = _NM; CurrentPR.IsBeingProcessed = true; CallFindPath(); } }
// void ResetPathFinder() { CurrentPR = null; CurrentStatus = PathfinderStatus.Incative; AvaliableThread.Abort(); AvaliableThread = null; CurrentNM = null; PFM = null; }
public void Awake() { if (Instance == null) { Instance = this; } else { Destroy(this); } }
public override void OnInspectorGUI() { base.OnInspectorGUI(); PathFinderManager TargetTestPFM = (PathFinderManager)target; if (GUILayout.Button("Test Direction Search")) { if (NodeManager.Instance.SetupCompletate) { Quadrent Gotquad = NodeManager.Instance.FindQuadrentFromWorldPosition(TargetTestPFM.gameObject.transform.position); Debug.Log(Gotquad.QuadrentPostion); } else { Debug.Log("Wait for NodeManager Setup is compleate"); } } }