public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var value = property.FindPropertyRelative("value"); var probability = property.FindPropertyRelative("probability"); PropertyLayoutHelper layout = new PropertyLayoutHelper(); layout.Begin(); layout.Add((rect) => { EditorGUI.PropertyField(rect, value, GUIContent.none); }); layout.Add((rect) => { EditorGUI.PropertyField(rect, probability, GUIContent.none); }); layout.End(); layout.Render(position); }
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { var layout = new PropertyLayoutHelper(); var key = property.FindPropertyRelative("key"); var type = property.FindPropertyRelative("type"); position = PropertyLayoutHelper.AdjustRect(position, EditorGUIUtility.singleLineHeight); layout.Begin(); layout.Add((rect) => { EditorGUI.PropertyField(rect, type, GUIContent.none); }, 40); layout.Add((rect) => { EditorGUI.PropertyField(rect, key, GUIContent.none); }, 150); layout.Add(DrawValue(key.stringValue, type)); layout.Add(DrawButton(key.stringValue, type), 20); layout.End(); layout.Render(position); }