What’s the best approach here? Create clones of existing tiles via Instantiate instead of loading them via Resources.Load ?
I doubt this would be fast enough to create bigger levels, especially on mobile devices…
I’ve also seen someone (youtube tutorial) creating meshes via script and texturing them, which seems to be really fast. Is this the best way to do this?
I don’t want to use an existing dungeon generator or something, much more fun figuring out everything myself. Just need a little push in the right direction
How do other people create tile based levels (via script)?
I did it the following way: 1. cut all map on squares, each square is a prefab, which store all containing gameobjects data 2. each visible square dynamically loaded using Resources.Load 3. when prefab is loaded, it immediately getting from pool all its gameobject and setting its data.
So basically saying square prefab contains only gameobjects data like position inside square\scale\rotation but not gameobject itself. That’s why each square is very lightweight and could be loaded very fast during runtime. When square become invisible it gets unloaded and all containing gameobjects return to pool. Consider splitting loading\unloading each square for different frames, for example you need to load 5 new squares and unload 5, then next 5 frames unloading one squre per frame and after loading new squares the same way.