From 94b8f55509cfea3706299abb7a909c9cd413ba80 Mon Sep 17 00:00:00 2001 From: Simon O'Shea Date: Sat, 5 Aug 2023 15:34:41 -0400 Subject: created mesh array - WIP the meshes are generated in a grid formation but not positioned correctly :( --- Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs') diff --git a/Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs b/Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs index e9dc790..873822a 100644 --- a/Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs +++ b/Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs @@ -53,9 +53,9 @@ public class LogicGrid // Enables us to convert the array's (x,y) pair into the user's world-space (also used to scale grid in constructor) - private Vector3 GetWorldPosition(int x, int y) + public Vector3 GetWorldPosition(int x, int y) { - return new Vector3(x, y) * this.cellSize + originPosition; + return new Vector3(x, y) * this.cellSize + this.originPosition; } private void getXY(Vector3 worldPosition, out int x, out int y) @@ -104,4 +104,18 @@ public class LogicGrid return GetValue(x, y); } + public int GetHeight() + { + return this.height; + } + + public int GetWidth() + { + return this.width; + } + + public float GetCellSize() + { + return this.cellSize; + } } -- cgit v1.3.1-4-g156e