diff options
| author | Simon O'Shea <osheas1@wit.edu> | 2023-08-09 09:37:44 -0400 |
|---|---|---|
| committer | Simon O'Shea <osheas1@wit.edu> | 2023-08-09 09:37:44 -0400 |
| commit | cd15c103c6f1113461ead6065e47130276cb61a1 (patch) | |
| tree | 0ed6f9bb68cd940f2a2f596cdd08a59afb93e9c6 /Pathfinding Visualizer/Assets/Scripts/CellMesh.cs | |
| parent | ea904845a7a73c1b8574b41b42897ee521849421 (diff) | |
astar is animated primitively
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() { |
