Advertisement
freakrho

Untitled

Feb 10th, 2020
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.65 KB | None | 0 0
  1. [CustomPropertyDrawer(typeof(CompositeAudioEvent.CompositeEntry))]
  2. public class CompositeEntryDrawer : PropertyDrawer
  3. {
  4.     public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
  5.     {
  6.         return 2 * EditorGUIUtility.singleLineHeight;
  7.     }
  8.  
  9.     public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
  10.     {
  11.         position.height = EditorGUIUtility.singleLineHeight;
  12.         EditorGUI.PropertyField(position, property.FindPropertyRelative("Event"));
  13.  
  14.         position.y += position.height;
  15.         EditorGUI.PropertyField(position, property.FindPropertyRelative("Weight"));
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement