public Vector2[] GetPathToEndNode(InternalBuildingNode startNode, string category) { // first get random available end node List <InternalBuildingNode> list = GetEdgeNodes(category); if (list.Count > 0) { InternalBuildingNode randomNode = list[Random.Range(0, list.Count)]; // then get path (SHOULD GET THE RIGHT ENTRANCE WHEN MULTIPLE LIKE IN GATE) Vector2[] path = BuildingPathfinding.CreatePath(startNode, randomNode); return(path); } else { print("could not find any available edge nodes with category = " + category); return(null); } }
void Exit() { entrance = building.GetEntrance(person, this); Vector2[] path = BuildingPathfinding.CreatePath(currentNode, entrance); person.VisitPosition(path); }
public Vector2[] GetPathToEndNode(InternalBuildingNode startNode, InternalBuildingNode endNode) { Vector2[] path = BuildingPathfinding.CreatePath(startNode, endNode); return(path); }