2D Game Development in Unity3D: Overview
Unity3D’s GUI class (previous post)
Pros:
- Very fast to use: only line of code is enough to display an image – no other actions or setup involved.
- Images can be displayed in a ‘pixel-perfect’ way.
|
Cons:
- Bad performance on iOS: not suitable for if more than 30-50 have to be simultaneously visible on screen (each image consumes one draw call).
- Using the physics engine is not possible without a workaround.
- Additional code is required to support different screen resolutions.
|
Pros:
- Fast on iOS: textures can be easily combined into texture Atlases, potentially resulting in only one draw call.
- Images can be displayed in a ‘pixel-perfect’ way.
- Most systems allow positioning sprites in the editor.
|
Cons:
- Slower to use: more code writing and setup involved.
- Using the physics engine is not possible without a workaround.
- Depending on the system used, additional code may be required to support different screen resolutions.
|
3D objects and orthographic projection (previous post)
Pros:
- Allows using the Unity3D editor to build your levels.
- Relatively fast UI on iOS and Android.
- Easy access to the physics engine.
- Easy to combine with other Unity3D features (e.g. particle effects, 3D animated characters and animation blending, …).
- Your game automatically works under different screen resolutions.
|
Cons:
- Performance can be optimized on iOS by using texture atlases, but requires additional setup.
- Using pixel coordinates to define the scale and position of objects is possible, but makes it a lot harder (or impossible) to get decent results from the physics engine.
|
As you can see, each of them has its own specific advantages and disadvantages. This means there is no ‘best’ method; all depends on the needs of your project.