//Main Pathfinding function, will be called to generate the path and will return the final path public List <SCR_NodeClass> FindingPath(SCR_NodeClass startPoint, SCR_NodeClass endPoint, List <SCR_NodeClass> nodeSelection) { listOfNodes = new List <SCR_NodeClass>(); listOfNodes = nodeSelection; pathfound = false; finalMapPathway = new List <SCR_NodeClass>(); open = new List <CalculatePath>(); closed = new List <CalculatePath>(); nodeManager = GetComponent <SCR_NodeManager>(); start = startPoint; goal = endPoint; open.Add(new CalculatePath(startPoint, null)); GeneratePath(); FindPath(); open.Clear(); closed.Clear(); return(finalMapPathway); }
private void OnEnable() { nodes = GameObject.FindGameObjectWithTag("PathFinderManager").GetComponent <SCR_NodeManager>(); }
//retreives necessary values when clicked on private void OnEnable() { nodeManager = (SCR_NodeManager)target; }
private void Start() { nodeManager = GameObject.FindGameObjectWithTag("PathFinderManager").GetComponent <SCR_NodeManager>(); offset = Map.transform.position.y + (transform.position.y - Map.transform.position.y); }