- Home /
Tiles pre-built or generated?
I think I read somewhere that you can run object generation code in the editor to then have objects baked into a scene. If I'm wrong about that than this question is irrelevant. However...
If I have a thousand or so "tiles" (just planes) that I want to stack together would it be better for me to generate them once in the designer and then simply assign the dynamics to them on the scene's loading (textures, sound emitters, etc...)? Would I gain performance doing this, or would it really even matter in the end?
Also, if I am generating them on the fly, I tend to want to keep them as few as possible because of the generation time, but if they were baked into the scene could I get more of the actual objects out there, or is the object count what's really killing me in the end?
Thanks much in advance for any and all advice.
Answer by Lance · Nov 16, 2010 at 02:22 AM
Okay, so I ended up pre-baking the tiles from planes created by http://www.unifycommunity.com/wiki/index.php?title=CreatePlane.
I can safely generate and level-load 16x16 with minimal impact, but going too far over that generates too much strain upon the initial rendering. I'm guessing it's because they are more than just planes (they are fully instantiated GameObjects), but either way - it's working now.
$$anonymous$$udos on answering it ins$$anonymous$$d of bleeding out the question. Nice link aswell , I probably will be using that soon. So thanks :)
Answer by JesusChristChangedMe · Oct 31, 2010 at 09:39 PM
not really sure what you mean by tiles... but if you mean terrain then just make one by going to the top menu bar and click terrian,and create terrain. but if your asking about putting different objects in a scene using one prefab then you can create a new prefab and drag all the gameobjects into that prefab. but if your asking if too many objects in a scene slows down unity then no matter how you group them... unity wont slow down very easily.
sorry, i dont really know what your asking.
I'm sorry, I don't know how better to clarify. As stated, I'm working with planes as tiles (think a grid to walk on), not a terrain. And no, I'm not talking about prefabs, I'm asking if I should be generating my grid of planes every time the level is loading, or if I would get a benefit from generating them in the editor and just having them baked into the scene. As of now, I have written an editor window that will allow the editor to generate the tiles for me and then I can just call that good. It does load faster, yes, but generating over 20x20 almost crashes Unity.
sorry, dont know much about generating grids. but you look like your getting somewhere with that. so the best i can do is wish you good luck and hope that someone that knows about this stuff can help you out. sorry i couldnt be more helpful. Good Luck :)
Your answer
Follow this Question
Related Questions
(Editor Scripting) Is it possible to generate MenuItems? 2 Answers
Asset Bundle starts loaded 0 Answers
How to get the particular static state(s) of a certain GameObject via script? 0 Answers
How to access Custom Inspector own gameObject 1 Answer
GameObject HideFlags.DontSave not working as expected 1 Answer