ItemDescriptionDrawer.cs 594 B

1234567891011121314151617181920
  1. using UnityEngine;
  2. using UnityEditor;
  3. namespace HQFPSWeapons
  4. {
  5. [CustomPropertyDrawer(typeof(ItemDescription))]
  6. public class ItemDescriptionDrawer : PropertyDrawer
  7. {
  8. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
  9. {
  10. position.x -= 16f;
  11. EditorGUI.PropertyField(position, property.FindPropertyRelative("Description"), GUIContent.none);
  12. }
  13. public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
  14. {
  15. return EditorGUI.GetPropertyHeight(property.FindPropertyRelative("Description"), label, true);
  16. }
  17. }
  18. }