Day 2: Reusable Objects
Objective: To explore the benefit of reusing objects that share the same qualities.
Often in game development we come into situations where we have to deal with countless objects that share the exact same qualities. Like discharging a firearm for example; a bullet explodes out of the chamber every time the trigger is pulled(if the firearm is properly maintained that is). Because we know that this will happen repeatedly, we can assume that all of the bullets being fired share the same qualities.
To make use of reusable objects, you’ll need to be very familiar with Unity’s prefab system. This excellent feature allows you to have countless instances of any game object provided you have the code to run it.

Prefabs are the key for Instantiation(creating game objects at runtime) and optimization.

Instantiation gives the programmer control over where a prefab can be spawned. This method comes with several options giving you control over position and rotation. This will come in handy in almost every Unity related endeavor; this comes in the form of visual effects, gameplay, communication to the player and so much more.

Optimization should always be emphasized and constantly tested to ensure users have the best experience possible. Utilizing the prefab system to it’s fullest will help our game run smoothly. Say for example we have several bullets to pool from in the scene that are NOT prefabs of a base bullet. If any of the speed values or life span values are different then the system has to work much harder to run.