Customizing a custom inspector!

Hi,

Is there a proper way of customizing a custom inspector from an asset vendor? For example, NGUI customizes the default transform inspector (for adding some useful buttons) and PrefabEvolution customizes the default gameobject inspector (for its own way of implementing stuff).

I still want to be able to add more buttons or labels into these inspectors. Basically, they are conflicting with my custom versions for those default inspectors.

How should we handle this situation? If I’m using a 3rd party that customizes a default inspector(say transform inspector), do I have to lose my ability to customize it for my self ?

You want to have another script that will handle that.
The new script must inherit from Editor and have this Attribute:

[CustomEditor(typeof(YourComponentClass))]

You then customize your component in the OnInspectorGUI method. Remember that the inherited field “target” will return the actual component as an object. You will have to cast it back to your component type:

YourComponentClass _target;
public override void OnInspectorGUI()
{
 _target = (YourComponentClass)target;
 // Draw all your stuff here using EditorGUI, GUI, GUILayout and EditorGUILayout classes as you normally would in the OnGUI function
}

Edit: I’m assuming we’re talking C# here. Never done this in UnityScript.

Reference: Unity - Scripting API: Editor