2 using System.Collections.Generic;
10 [CustomEditor(typeof(StudioGlobalParameterTrigger))]
11 public class StudioGlobalParameterTriggerEditor : Editor
13 SerializedProperty param;
14 SerializedProperty trigger;
15 SerializedProperty tag;
16 SerializedProperty value;
18 SerializedProperty data1, data2;
21 EditorParamRef editorParamRef;
25 param = serializedObject.FindProperty("parameter");
26 trigger = serializedObject.FindProperty("TriggerEvent");
27 tag = serializedObject.FindProperty("CollisionTag");
28 value = serializedObject.FindProperty("value");
31 public override void OnInspectorGUI()
33 EditorGUILayout.PropertyField(trigger, new GUIContent("Trigger"));
34 if (trigger.enumValueIndex >= (int)EmitterGameEvent.TriggerEnter && trigger.enumValueIndex <= (int)EmitterGameEvent.TriggerExit2D)
36 tag.stringValue = EditorGUILayout.TagField("Collision Tag", tag.stringValue);
39 EditorGUI.BeginChangeCheck();
41 var oldParam = param.stringValue;
42 EditorGUILayout.PropertyField(param, new GUIContent("Parameter"));
44 if (!String.IsNullOrEmpty(param.stringValue))
46 if (!editorParamRef || param.stringValue != oldParam)
48 editorParamRef = EventManager.ParamFromPath(param.stringValue);
51 EditorGUILayout.BeginHorizontal();
52 EditorGUILayout.PrefixLabel("Override Value");
53 value.floatValue = EditorGUILayout.Slider(value.floatValue, editorParamRef.Min, editorParamRef.Max);
54 EditorGUILayout.EndHorizontal();
57 serializedObject.ApplyModifiedProperties();