Prototype to Production
Replacing placeholders
Example situation: Your game prototype has the core mechanics done and you’re happy how to plays. The decision is made to go into production.
We used default 3d objects for our shooter and now we are going to replace them with assets.
Add background
Just drag and drop a image into the Scene view and adjust the scale so it fits the screen.
Replace Player
Drag the player into the hierarchy and make sure to copy the Component of the player prototype. Then you can delete the player.
Add component: Box Collider 2D and Edit Collider. Check Is Trigger.
Set tag to Player.
Replace Enemy
Our Enemy is an Prefab. From the Project view we edit it. We going from 3D to 2D so delete the following components: MeshRenderer, Box Collider, Rigidbody. Those are all for 3d.
Add component: Sprite Renderer and set the sprite you want.
Add component: Rigidbody 2D and set gravity scale to 0.
Add component: Box Collider 2D and Edit Collider. Check Is Trigger.
3D to 2D: Update the Script
Change the OnTriggerEnter to OnTriggerEnter2D
Change the Collider type to Collider2D
If you have more collisions in your scripts, adjust accordingly.
Replace Laser
Same as the Enemy prefab above.
Adjust offset in script.
Final Result
Check functionality
Always verify if the game is still behave as before replacing your assets.
Sorting layers
In 2D some objects are in front of others. This achieved by setting here: Object > Inspector > Sprite Renderer > Order Layer. You can also create your own named Layers and use those to put objects on the same layer, which is recommended.