private static T ObjectFieldWithUndo <T>(
            this Object obj,
            T value,
            GUIContent label
            ) where T : Object
        {
            EditorGUI.BeginChangeCheck();

            var newValue = ScriptableEventGUI.ObjectField(value, label);

            if (EditorGUI.EndChangeCheck())
            {
                RecordUndo(obj, label);
            }

            return(newValue);
        }
Exemplo n.º 2
0
 protected override GameObject DrawArgField(GameObject value)
 {
     return(ScriptableEventGUI.ObjectField(value, isAllowSceneObjects: true));
 }
 protected override Collider DrawArgField(Collider value)
 {
     return(ScriptableEventGUI.ObjectField(value, isAllowSceneObjects: true));
 }
 protected override Transform DrawArgField(Transform value)
 {
     return(ScriptableEventGUI.ObjectField(value, isAllowSceneObjects: true));
 }