Shouldn't GetGridPosition/GetWorldPosition (and similar) be static?

GetGridPosition inside GridSystem.cs doesn’t care about the internal state of anything, and can easily be made static. Doing this sidesteps the need to expose anything related to Grid<=> World inside LevelGrid.

It uses the cell size, so it does care about the internal state.

It does care about the cell size. That being said, if you know the cell size won’t be changing, you can hard code it into your grid math functions.

Privacy & Terms