I has a PropertyDrawer, everything goes fine, except one feature: I can't figure out how to add button and I use checkbox instead
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomPropertyDrawer (typeof (InteractiveObject))]
class InteractiveObjectPropertyDrawer : PropertyDrawer {
public override void OnGUI (Rect position, SerializedProperty property, GUIContent label) {
EditorGUI.BeginProperty (position, label, property);
position = EditorGUI.PrefixLabel (position, GUIUtility.GetControlID (FocusType.Passive), label);
var indent = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
Rect colorRect = new Rect (position.x, position.y, 40, position.height);
Rect unitRect = new Rect (position.x + 50, position.y, 90, position.height);
Rect nameRect = new Rect (position.x + 150, position.y, position.width - 150, position.height);
EditorGUI.BeginChangeCheck();
EditorGUI.PropertyField (colorRect, property.FindPropertyRelative ("show"), GUIContent.none);
if (EditorGUI.EndChangeCheck() ) {
RenderSettings.skybox.SetColor("_highlight", property.FindPropertyRelative ("id").colorValue);
}
EditorGUI.PropertyField (unitRect, property.FindPropertyRelative ("name"), GUIContent.none);
EditorGUI.PropertyField (nameRect, property.FindPropertyRelative ("name"), GUIContent.none);
EditorGUI.indentLevel = indent;
EditorGUI.EndProperty ();
}
}
How I can add button there?

