コード例 #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);
        }
    }
コード例 #2
0
 void Exit()
 {
     entrance = building.GetEntrance(person, this);
     Vector2[] path = BuildingPathfinding.CreatePath(currentNode, entrance);
     person.VisitPosition(path);
 }
コード例 #3
0
 public Vector2[] GetPathToEndNode(InternalBuildingNode startNode, InternalBuildingNode endNode)
 {
     Vector2[] path = BuildingPathfinding.CreatePath(startNode, endNode);
     return(path);
 }