Hi All, I am trying to make an huge grid in the style of Minesweeper. What I want the player to be able to do is to scroll around the grid and to zoom in and out to see the whole grid or a specific part of it. Each grid tile has a number or a symbol on it. I am a bit confused on how to tackle this. Making a huge grid made up of quads is not a good way of doing this I would guess, since that would be inefficient. Does anyone have a suggestion on how to tackle this?
Yeah, each tile would be modifiable. Not too hard to store that in a 2D array though. The problem is scrolling trough a huge number of tiles. There is no use them actually existing if they are not in view.
You have some options. - Use a projector with grid texture - Use dirctional light with cookie set to gridmaterial - Use GL class to render lines GL class is maybe most flexible but a projector is easier to set up. However, I noticed some bug where the grid isnt completely projected whenever I zoom out too much. A directional light with cookie doesnt have this issue but it dramatically increases drawcalls. Projectors work good on flat surfaces, on a sloped surface the texture might get noticeablely stretched. Last of all choices would be line renderer but since a line renderer means a drawcall it's not a viable option.
But how would I use that when scrolling? Also, I want to depict numbers on the different grid tiles. How would I do that efficiently?
You could have a class for your grid item. Which has the value on. Then Instantiate the prefab on start Something like this(pseudo code) Public Class gridItem { Int xPos Int yPos Int value } Public class your mono behavior { Public gridItem[] myGridItemsArray; Start () { //initialise your grid } }