DelayedClipDrawer.cs 564 B

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