- Home /
Individual tile data
Here is my problem, I have a grid that has 240,000 tiles in it. Players will be able to build on tiles and harvest resources. As a result, each tile needs to be able to store it's own individual data on how many resources are available on that tile and update in real time. In addition there will be more than 1 type of tile. For example, Mountain tiles will have more stone than a forest tile does, but a forest tile will have more wood than a mountain tile does, etc etc. In addition I need the script to assign a "Random.Range(stoneMin, stoneMax); of all tiles.
I have gotten as far as being able to get the script to understand that each tile has its own tile type via a tilebase. But i have no way of accessing that tilebase information and using it in an "if" statement. For example:
if(Tile from tilebase == the tile type of a "forest") { Then give it Random.Range(woodMin, woodMax); } if(Tile from tilebase == the tile type of a "mountain) { Then give it a Random.Range(stoneMin, stoneMax); } Remember that each tile has to be able to store its own stats.
I have tried using a scriptable object but then I am not able to give each individual tile it's own individual stats.
Any help would be appreciated. Thank you
Your answer
Follow this Question
Related Questions
How to find sprite at grid location? 1 Answer
TILE MOVEMENT 0 Answers
How can I compare two tilemaps by color? 1 Answer
Tile Mapping not scaling correctly! 0 Answers
Grid and or Tile System 0 Answers