astar is animated primitively

This commit is contained in:
Simon O'Shea
2023-08-09 09:37:44 -04:00
parent ea904845a7
commit cd15c103c6
3 changed files with 32 additions and 20 deletions
@@ -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()
{