public void BakeObjectRealTime(Pathfinding_Bakeable _bakeable) { BakeProcess bP = new BakeProcess(_bakeable); realtimeBake.Add(bP); StartCoroutine(_BakeObjectRealTime(bP)); }
private IEnumerator WaitForPathfindable() { p = PathFinding.self; bake = GetComponent <Pathfinding_Bakeable>(); while (!PathFinding.pathfindable) { yield return(null); } //array information lengthX = p.grid.GetLength(0) - 1; lengthY = p.grid.GetLength(1) - 1; lengthZ = p.grid.GetLength(2) - 1; }
private IEnumerator _BakeObjectRealTime(Pathfinding_Bakeable bakeable) { GameObject g = bakeable.gameObject; bakeable.myNodes = BakeObject(g, bakeable.bakeType); while (true) { //reset old nodes bakeable.oldNodes = bakeable.myNodes; if (bakeable.oldNodes != null) { foreach (Node oldNode in bakeable.oldNodes) { oldNode.filled = false; } } bakeable.myNodes = BakeObject(g, bakeable.bakeType); yield return(new WaitForSeconds(bakeable.refreshSpeed)); } }
public void BakeObjectRealTime(Pathfinding_Bakeable bakeable) { realtimeBake.Add(StartCoroutine(_BakeObjectRealTime(bakeable))); }
public BakeProcess(Pathfinding_Bakeable bakeable) { this.bakeable = bakeable; obj = bakeable.gameObject; }
private void Start() { p = PathFinding.self; bake = GetComponent <Pathfinding_Bakeable>(); MoveTowards(goal.position, null); }