You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.1 KiB
33 lines
1.1 KiB
5 months ago
|
using UnityEditor;
|
||
|
|
||
|
namespace HighlightPlus {
|
||
|
|
||
|
[CustomEditor(typeof(HighlightSeeThroughOccluder))]
|
||
|
public class HighlightSeeThroughOccluderEditor : Editor {
|
||
|
|
||
|
SerializedProperty mode, detectionMethod;
|
||
|
|
||
|
void OnEnable() {
|
||
|
mode = serializedObject.FindProperty("mode");
|
||
|
detectionMethod = serializedObject.FindProperty("detectionMethod");
|
||
|
}
|
||
|
|
||
|
public override void OnInspectorGUI() {
|
||
|
|
||
|
serializedObject.Update();
|
||
|
|
||
|
EditorGUILayout.PropertyField(mode);
|
||
|
if (mode.intValue == (int)OccluderMode.BlocksSeeThrough) {
|
||
|
EditorGUILayout.HelpBox("This object will occlude any see-through effect.", MessageType.Info);
|
||
|
EditorGUILayout.PropertyField(detectionMethod);
|
||
|
} else {
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
serializedObject.ApplyModifiedProperties();
|
||
|
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|