Reference properties are properties that reference other objects such as GameObjects, Components, or Assets. The reference slot will show what kind of objects can be used for this reference.
The Audio Clip property slot shows that it accept references to objects of type Audio Clip
Now an Audio Clip file is referenced in the Audio Clip property.
This type of referencing is very quick and powerful, especially when using scripting. To learn more about using scripts and properties, see the Scripting Tutorial on the Tutorials page.
Object references can be assigned to a reference property either by drag and drop or by using the Object Picker.
You can use drag and drop simply by selecting the desired object in the Scene View, Hierarchy, or Project View and dragging it into the slot of the reference property.
If a reference property accepts a specific Component type (for example a Transform) then dragging a GameObject or a Prefab onto the reference property will work fine provided that the GameObject or Prefab contains a component of the correct type. The property will then reference the component in question, even though it was a GameObject or Prefab you dragged onto it.
If you drag an object onto an reference property, and the object is not of the correct type, or does not contain the right component, then you won't be able to assign the object to the reference property.
You can click on the small target icon next to a reference slot to open the Object Picker.
The Object Picker is a simple window for assigning objects in the inspector after allowing you to preview and search those available.
Although the Object Picker is really easy to use, there are a few things you should be aware of. These are described below.
The Object Picker works on any asset you have in your project, which can be a video, a song, a terrain, a GUI skin, a scripting file, or a mesh; it is a tool you will use often.
Page last updated: 2012-08-13