diff options
Diffstat (limited to 'Pathfinding Visualizer/Assets/Scripts/CellMesh.cs')
| -rw-r--r-- | Pathfinding Visualizer/Assets/Scripts/CellMesh.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Pathfinding Visualizer/Assets/Scripts/CellMesh.cs b/Pathfinding Visualizer/Assets/Scripts/CellMesh.cs index 9e62969..aa6acc8 100644 --- a/Pathfinding Visualizer/Assets/Scripts/CellMesh.cs +++ b/Pathfinding Visualizer/Assets/Scripts/CellMesh.cs @@ -78,6 +78,24 @@ public class CellMesh : MonoBehaviour mesh.triangles = triangles; } + public void Animate(Stack<Node> result) + { + int count = result.Count; + for (int i = 0; i < count; i++) + { + Node n = result.Pop(); + Debug.Log("Agent at: " + n.agent.x + ", " + n.agent.y); + Debug.Log(n.lastMove); + + grid.SetValue(n.agent.x, n.agent.y, 3); + //grid.SetValue(n.parent.agent.x, n.parent.agent.y, 0); + + UpdateCellVisual(); + + } + } + + void Start() { |
