Hi, I want to customize how a type is drawn in the state window.
I wrote this code:
using PropertyDrawer = HutongGames.PlayMakerEditor.PropertyDrawer;
[PropertyDrawer(typeof(MyType))]
public class MyTypePropertyDrawer : PropertyDrawer
{
public override object OnGUI(GUIContent label, object obj, bool isSceneObject, params object[] attributes)
{
Debug.Log("OK MyTypePropertyDrawer WORKS");
MyType myObject = obj as MyType;
GUILayout.BeginVertical();
GUILayout.Label(myObject.myStringField);
GUILayout.EndVertical();
return obj;
}
}
public class TestAction : FsmStateAction
{
public MyType myObject;
}
I expect to see TestAction in the editor showing just a label with the value of myObject.myStringField, but the property drawer is never called (the log doesn't show up).
How it is supposed to be used the HutongGames.PlayMakerEditor.PropertyDrawer class?