How to Create and Use Prefabs in Unity
Notes:
How to Create and Use Prefabs in Unity :
Prefab: is a reusable template
Prefab is a wrapper for a game object and its associated components
Note: Prefabs are created to reuse game objects in one or more scenes
Creating prefabs:
Create a prefab:
Assets menu - Create - Prefab - Name the prefab - Enter - Drag the object to the prefab
OR
Drag the game object directly into a folder created for storing prefabs
Creating instance:
Drag the prefab into Hierarchy panel or into the scene to create an instance
Note: Once you create a prefab; you can create infinite number of instances of it
Editing prefabs:
If you select an instance of a prefab, you find select, apply & revert buttons in the inspector.
Select button:
Selects the prefab asset from which the selected game object was created
Apply button:
Any modifications done to an instance are applied to its prefab
Any edits made to a prefab are immediately affected to all of its instances
Revert button:
Reverts a broken instance to an instance of original prefab