HighlightSeeThroughOccluderEditor.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. using UnityEditor;
  2. using UnityEngine;
  3. namespace HighlightPlus {
  4. [CustomEditor(typeof(HighlightSeeThroughOccluder))]
  5. public class HighlightSeeThroughOccluderEditor : Editor {
  6. SerializedProperty mode, detectionMethod;
  7. void OnEnable() {
  8. mode = serializedObject.FindProperty("mode");
  9. detectionMethod = serializedObject.FindProperty("detectionMethod");
  10. }
  11. public override void OnInspectorGUI() {
  12. serializedObject.Update();
  13. EditorGUILayout.PropertyField(mode);
  14. if (mode.intValue == (int)OccluderMode.BlocksSeeThrough) {
  15. EditorGUILayout.HelpBox("This object will occlude any see-through effect.", MessageType.Info);
  16. EditorGUILayout.PropertyField(detectionMethod);
  17. } else {
  18. EditorGUILayout.HelpBox("This object will trigger see-through effect. Use only on objects that do not write to depth buffer normally, like sprites or transparent objects.", MessageType.Info);
  19. }
  20. serializedObject.ApplyModifiedProperties();
  21. }
  22. }
  23. }