private void Awake() { if (singleton == null) { singleton = this; } }
// Update is called once per frame void Update() { if (start) { start = false; //Pathfinder path = new Pathfinder(); // testing purposes // grid[1, 0, 1].isWalkable = false; // Pass the target nodes Node startNode = GetNodeFromVector3(startNodePosition); Node end = GetNodeFromVector3(endNodePosition); //path.startPosition = startNode; //path.endPosition = end; // find the path // List<Node> p = path.FindPath(); // disbale the world object for each node we agoing to pass from startNode.worldObject.SetActive(false); for (int i = 0; i < agents; i++) { PathfinderMaster.GetInstance().RequestPathfind(startNode, end, ShowPath); } } }
private void Awake() { instance = this; }