Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEditor;
- using System.Collections;
- [CustomPropertyDrawer(typeof(Test))]
- public class TestPropertyDrawer : PropertyDrawer {
- float lineHeight = 16;
- float lineMargin = 2;
- public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
- {
- EditorGUI.BeginProperty(position, label, property);
- SerializedProperty PropTestInt = property.FindPropertyRelative("testInt");
- PropTestInt.intValue = EditorGUI.IntField(new Rect(position.x, position.y + lineHeight, position.width, lineHeight), PropTestInt.intValue);
- EditorGUI.EndProperty();
- }
- public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
- {
- return lineHeight;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement