Hello again to all unity fellows. I have been out for 6 months and I plan to make a return really soon. I’m thiking about building a 2D game this time. Has arrived any good 2D lib for iphone? By 2D lib I mean draw sprites with batching, etc…
I think SM1 combines everything into one mesh instead of relying on Unity’s batching, which might be slower now that it’s no longer needed.
I could be wrong though.
I was thinking exactly the same. And Z problems will arises too I think.
By the way 2 more questions if yhou don’t mind, my game will be composed of a lot of images that come from an atlas. Each image will be a Game Object (GO). I know images will batch and only GO’s in the frustum will render, but will the big quantity of gos slow the thing down? I think I will have 2000 or 3000 in the full scene (big map).
In the other hand, I have ussually used box2d segments for collisions (2d game here), will it be a probjem to have boxes for the collisions? I mean in terms of perfermance.
You will almost certainly need to add code that disables the GO’s when they’re not in the vicinity of the frustrum.
However, checking 2000 GO’s every frame might be pretty heavy, so you’ll have to be smart about it. Two ideas:
Check X number of objects with a coroutine.
Divide the objects into a grid, so you know which ones are near and which ones aren’t.
I forgot to say this objects are static… I mean they will be just used for rendering purposes. This is why I think that being out of the frustum will be enough, but not sure. Don’t know if unity uses any kind of algorithm apart from frustum culling for this.
By the way following my collisions question, I think only option is just use boxes althought just sprite is shown.
Yeah, as long as you have no scripts running on them it could be fine, but I can’t say that for certain. You’ll have to test.
You might want to combine them into groups though.
And yes, you’ll probably have to use boxes or spheres as colliders. Unity’s physics are in 3D, even if you only need 2D. But this works fine.