Ejemplo n.º 1
0
 private void Awake()
 {
     if (singleton == null)
     {
         singleton = this;
     }
 }
Ejemplo n.º 2
0
    // 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);
            }
        }
    }
Ejemplo n.º 3
0
 private void Awake()
 {
     instance = this;
 }