Pages

Thursday, June 23, 2011

Prefabs

A Prefab is a type of asset -- a reusable Game Object stored in Project View. Prefabs can be inserted into any number of scenes, multiple times per scene. When you add a Prefab to a scene, you create an instance of it. All Prefab instances are linked to the original Prefab and are essentially clones of it. No matter how many instances exist in your project, when you make any changes to the Prefab you will see the change applied to all instances.

How to Add New Prefab in Menu :
A new, empty Prefab. It cannot be instanced until you fill it with a GameObject.
To fill the Prefab, you use a GameObject that you've created in the scene.
  1. Choose Assets->Create->Prefab from the menu bar and name your new Prefab.
  2. In Hierarchy View, select the GameObject you wish to make into a Prefab.
  3. Drag & drop the GameObject from the Hierarchy onto the new Prefab in Project View.
After you have performed these steps, the Game Object and all its children have been copied into the Prefab data. The Prefab can now be re-used in multiple instances. The original Game Object in the Hierarchy has now become an instance of the Prefab.
Now Drag object into that Prefab .
How to Modify Properties of prefab :
This allows you to modify Prefab instances to make them unique from their source Prefabs without breaking the Prefab link.
Now How this imported prefab look likes

--
Vivek p Shah
Game Developer in Unity3d and Cocos2d
Reference : www.unity3d.com

0 comments:

Post a Comment