Ejemplo n.º 1
0
    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);
 }
Ejemplo n.º 3
0
 public Vector2[] GetPathToEndNode(InternalBuildingNode startNode, InternalBuildingNode endNode)
 {
     Vector2[] path = BuildingPathfinding.CreatePath(startNode, endNode);
     return(path);
 }