diff options
| author | Simon O'Shea <osheas1@wit.edu> | 2023-08-05 15:34:41 -0400 |
|---|---|---|
| committer | Simon O'Shea <osheas1@wit.edu> | 2023-08-05 15:34:41 -0400 |
| commit | 94b8f55509cfea3706299abb7a909c9cd413ba80 (patch) | |
| tree | 199206ab5289a917faeb4b88cbf3759f5a75c4d0 /Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs | |
| parent | 31151bc9b6fdcd5ade2f8176c17f50f67b58e5d0 (diff) | |
created mesh array - WIP
the meshes are generated in a grid formation but not positioned correctly :(
Diffstat (limited to 'Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs')
| -rw-r--r-- | Pathfinding Visualizer/Assets/Scripts/LogicGrid.cs | 18 |
1 files changed, 16 insertions, 2 deletions
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; + } } |
