LayerAttributeDrawer.cs 475 B

12345678910111213141516171819
  1. using System;
  2. using UnityEngine;
  3. using System.Collections;
  4. #if UNITY_EDITOR
  5. using UnityEditor;
  6. #endif
  7. namespace Lux_SRP_GrassDisplacement {
  8. #if UNITY_EDITOR
  9. [CustomPropertyDrawer(typeof(LayerAttribute))]
  10. public class LayerAttributeDrawer : PropertyDrawer {
  11. public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) {
  12. property.intValue = EditorGUI.LayerField(position, label, property.intValue);
  13. }
  14. }
  15. #endif
  16. }