Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [CustomPropertyDrawer(typeof(TestSprite))]
- public class TestSpriteDrawer : PropertyDrawer
- {
- public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
- {
- return 140f;
- }
- public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
- {
- var spriteProp = property.FindPropertyRelative("mySpriteTest");
- EditorGUI.LabelField(new Rect(position.x, position.y, position.width, 16), "Sprite");
- Rect objectFieldRect = new Rect(position.x, position.y + 20, 128, 128);
- EditorGUI.PropertyField(objectFieldRect, spriteProp, GUIContent.none);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment