Case Status
Log In


Home ยป API Reference»ObjectPropertyDrawer
Community Wiki


Extend this class to make a custom property drawer for an FsmObject variable of a specific type.

The property drawer will be used in Action Editors and Variable Editors.

  • NOTE: This is an Editor script, and should be in an Editor folder.
  • Use the ObjectPropertyDrawerAttribute to define the Object type to edit.

C# Example:

This example defines a custom property drawer for any AudioClip parameter. 

Save the script as ObjectPropertyDrawerTest.cs in an Editor folder and look at any AudioClip parameter in an action.

Object OnGUI(GUIContent label, Object obj, bool isSceneObject, params object[] attributes)

Use EditorGUILayout and GUILayout controls to build the property drawer.

Return the modified Object.

Parameter Description
GUIContent label A label that includes a tooltip.
Object obj The object to edit.
bool isSceneObject

Is obj a scene object. If false, it is used in a prefab, template, or global variables asset.

This is good to know if you're going to use an ObjectField with allowSceneObjects.

object[] attributes

The custom attributes defined for this parameter.

You can use custom attributes for formatting etc.



Last modified on 5/17/2013 9:00 PM by User.

  • RSS Feed