11using UnityEditorInternal;
17 private ReorderableList list;
20 list =
new ReorderableList(serializedObject,
21 serializedObject.FindProperty(
"Layers"),
22 true,
true,
true,
true);
23 list.drawHeaderCallback = drawHeader;
24 list.drawElementCallback = drawElement;
25 list.elementHeight = EditorGUIUtility.singleLineHeight * 7;
34 private bool showEventTrigger() {
35 bool showEventTrigger =
false;
36 if (
target.Layers !=
null) {
37 for (
int i = 0; i <
target.Layers.Length; i++) {
38 if (
target.Layers[i].TriggerLayerEvent) {
39 showEventTrigger =
true;
43 return showEventTrigger;
46 private void doLayoutList(SerializedProperty p) {
50 private void drawHeader(Rect rect) {
51 EditorGUI.LabelField(rect,
"Floating UI Layers");
54 private void drawElement(Rect rect,
int index,
bool isActive,
bool isFocused) {
55 var element = list.serializedProperty.GetArrayElementAtIndex(index);
59 EditorGUI.PropertyField(r, element.FindPropertyRelative(
"LayerTransform"));
60 r.y += EditorGUIUtility.singleLineHeight;
61 EditorGUI.PropertyField(r, element.FindPropertyRelative(
"MaxFloatDistance"));
62 r.y += EditorGUIUtility.singleLineHeight;
63 EditorGUI.PropertyField(r, element.FindPropertyRelative(
"MinFloatDistance"));
64 r.y += EditorGUIUtility.singleLineHeight;
65 EditorGUI.PropertyField(r, element.FindPropertyRelative(
"Shadow"));
66 r.y += EditorGUIUtility.singleLineHeight;
67 EditorGUI.PropertyField(r, element.FindPropertyRelative(
"ShadowOnAboveLayer"));
68 r.y += EditorGUIUtility.singleLineHeight;
69 EditorGUI.PropertyField(r, element.FindPropertyRelative(
"TriggerLayerEvent"));
void specifyConditionalDrawing(string conditionalName, params string[] dependantProperties)
Specify a list of properties that should only be displayed if the conditional property has a value of...
void specifyCustomDrawer(string propertyName, Action< SerializedProperty > propertyDrawer)
Specify a callback to be used to draw a specific named property. Should be called in OnEnable.