I'm trying to update the surrounding grid of tiles if one of them is disabled (not removed). For example, imagine we have a grid of tiles each with x representing one texture:
x, x, x, x, x, x
x, x, x, x, x, x
x, x, x, x, x, x
x, x, x, x, x, x
x, x, x, x, x, x
x, x, x, x, x, x
Now if some of these tiles are disabled, I need to update the surrounding tile textures to a different texture:
x, x, x, x, x, x
x, y, y, y, x, x
x, y, , y, y, y
x, y, , y, , y
x, y, y, y, , y
x, x, x, y, y, y
I'm trying to find the most efficient way of doing this. At present all of the tile data is stored in a dictionary with the key as a vector2.
I'm using C#/Unity 3D, however, I'm not necessarily looking for code but more or less logic on how to do this efficiently so I can program it in.
Any suggestions, examples, or what not would be helpful.
Thanks.