void Start() { pathfinder = GetComponent <PathfinderStar>(); thePath = pathfinder.GetPath(nodeCreator.GetNodeByPosition(transform.position), nodeCreator.GetNodeByPosition(mine.transform.position)); id = 0; destiny = Vector3.zero; }
void Start() { pathfinder = GetComponent <PathfinderDepth>(); thePath = pathfinder.GetPath(nodeCreator.GetNodeByPosition(transform.position), nodeCreator.GetNodeByPosition(mine.transform.position)); id = thePath.Count - 1; Debug.Log(id); destiny = Vector3.zero; }
void Start() { Init(); goingToMine = GetComponent <PathfinderStarToMine>(); goingToWarehouse = GetComponent <PathfinderStarToWarehouse>(); // pathfinderStar = GetComponent<PathfinderStar>(); thePathMine = goingToMine.GetPath(nodes.GetNodeByPosition(transform.position), nodes.GetNodeByPosition(mine.transform.position)); // thePathMine = pathfinderStar.GetPath(nodes.GetNodeByPosition(transform.position), nodes.GetNodeByPosition(mine.transform.position)); Debug.Log("PathMine: " + thePathMine.Count); Debug.Log("Mine: " + mine.transform.position); Debug.Log("MNode: " + nodes.GetNodeByPosition(mine.transform.position).transform.position); thePathWarehouse = goingToWarehouse.GetPath(nodes.GetNodeByPosition(transform.position), nodes.GetNodeByPosition(warehouse.transform.position)); // thePathWarehouse = pathfinderStar.GetPath(nodes.GetNodeByPosition(transform.position), nodes.GetNodeByPosition(warehouse.transform.position)); Debug.Log("PathWarehouse: " + thePathWarehouse.Count); Debug.Log("Warehouse: " + warehouse.transform.position); Debug.Log("WNode: " + nodes.GetNodeByPosition(warehouse.transform.position).transform.position); id = 0; destiny = Vector3.zero; }