public override void OnInspectorGUI() { EditorGUILayout.LabelField("<size=20><color=#f542da>Option Selector Adapter</color></size>", new GUIStyle(EditorStyles.label) { richText = true, alignment = TextAnchor.MiddleCenter }, GUILayout.Height(50)); serializedObject.Update(); TA_OptionSelector action = (TA_OptionSelector)target; if (!ThryActionEditor.MakeSureItsAnUdonBehaviour(action)) { return; } action.action = (ThryAction)EditorGUILayout.ObjectField(new GUIContent("Thry Action"), action.action, typeof(ThryAction), true); action.selectedText = (Text)EditorGUILayout.ObjectField(new GUIContent("Selected Text"), action.selectedText, typeof(Text), true); list.DoLayoutList(); EditorGUILayout.LabelField("Optional", EditorStyles.boldLabel); action._optionalAnimator = (Animator)EditorGUILayout.ObjectField(new GUIContent("Animator"), action._optionalAnimator, typeof(Animator), true); serializedObject.ApplyModifiedProperties(); }
public override void OnInspectorGUI() { EditorGUILayout.LabelField("<size=20><color=#f542da>Slider Adapter</color></size>", new GUIStyle(EditorStyles.label) { richText = true, alignment = TextAnchor.MiddleCenter }, GUILayout.Height(50)); serializedObject.Update(); TA_Slider action = (TA_Slider)target; if (!ThryActionEditor.MakeSureItsAnUdonBehaviour(action)) { return; } action.action = (ThryAction)EditorGUILayout.ObjectField(new GUIContent("Thry Action"), action.action, typeof(ThryAction), true); action._uiSlider = (Slider)EditorGUILayout.ObjectField(new GUIContent("Slider"), action._uiSlider, typeof(Slider), true); EditorGUILayout.LabelField("Optional", EditorStyles.boldLabel); action._optionalAnimator = (Animator)EditorGUILayout.ObjectField(new GUIContent("Animator"), action._optionalAnimator, typeof(Animator), true); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Handle:"); action._uiSliderHandlePrefix = EditorGUILayout.TextField(action._uiSliderHandlePrefix); action._uiSliderHandleText = (Text)EditorGUILayout.ObjectField(action._uiSliderHandleText, typeof(Text), true); action._uiSliderHandlePostfix = EditorGUILayout.TextField(action._uiSliderHandlePostfix); EditorGUILayout.EndHorizontal(); /*Really neat code, which is why i am leaving it in, but not really needed anymore * action._useCurve = EditorGUILayout.Toggle("Use Curve", action._useCurve); * if (action._useCurve) * { * if (action._curve == null) * { * action._curve = AnimationCurve.Linear(0, 0, 1, 1); * action._reverseCurve = ReverseCurve(action._curve); * } * EditorGUI.BeginChangeCheck(); * action._curve = EditorGUILayout.CurveField("Float Transformation Curve", action._curve); * if (EditorGUI.EndChangeCheck()) action._reverseCurve = ReverseCurve(action._curve); * //EditorGUILayout.CurveField("Reverse Curve", action._reverseCurve); * }*/ }
public override void OnInspectorGUI() { EditorGUILayout.LabelField("<size=20><color=#f542da>Player Collider Adapter</color></size>", new GUIStyle(EditorStyles.label) { richText = true, alignment = TextAnchor.MiddleCenter }, GUILayout.Height(50)); serializedObject.Update(); TA_PlayerTrigger action = (TA_PlayerTrigger)target; if (!ThryActionEditor.MakeSureItsAnUdonBehaviour(action)) { return; } action.action = (ThryAction)EditorGUILayout.ObjectField(new GUIContent("Thry Action"), action.action, typeof(ThryAction), true); action.onlyLocalPlayer = EditorGUILayout.Toggle("Only Local Player", action.onlyLocalPlayer); action.reactToTrigger = EditorGUILayout.Toggle("Fire on Trigger", action.reactToTrigger); action.reactToCollision = EditorGUILayout.Toggle("Fire on Collision", action.reactToCollision); }
public override void OnInspectorGUI() { EditorGUILayout.LabelField("<size=20><color=#f542da>Toggle Adapter</color></size>", new GUIStyle(EditorStyles.label) { richText = true, alignment = TextAnchor.MiddleCenter }, GUILayout.Height(50)); serializedObject.Update(); TA_Toggle action = (TA_Toggle)target; if (!ThryActionEditor.MakeSureItsAnUdonBehaviour(action)) { return; } action.action = (ThryAction)EditorGUILayout.ObjectField(new GUIContent("Thry Action"), action.action, typeof(ThryAction), true); action._uiToggle = (Toggle)EditorGUILayout.ObjectField(new GUIContent("Toggle"), action._uiToggle, typeof(Toggle), true); EditorGUILayout.LabelField("Optional", EditorStyles.boldLabel); action._optionalAnimator = (Animator)EditorGUILayout.ObjectField(new GUIContent("Animator"), action._optionalAnimator, typeof(Animator), true); }
public override void OnInspectorGUI() { EditorGUILayout.LabelField("<size=20><color=#f542da>Interact Adapter</color></size>", new GUIStyle(EditorStyles.label) { richText = true, alignment = TextAnchor.MiddleCenter }, GUILayout.Height(50)); serializedObject.Update(); TA_Interact action = (TA_Interact)target; if (!ThryActionEditor.MakeSureItsAnUdonBehaviour(action)) { return; } UdonSharpEditor.UdonSharpGUI.DrawInteractSettings(action); if (action.action == null) { if (action.gameObject.GetComponent <ThryAction>() != null) { action.action = action.gameObject.GetComponent <ThryAction>(); } } action.action = (ThryAction)EditorGUILayout.ObjectField(new GUIContent("Thry Action"), action.action, typeof(ThryAction), true); }
public override void OnInspectorGUI() { // Draws the default convert to UdonBehaviour button, program asset field, sync settings, etc. //if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return; serializedObject.Update(); action = (ThryAction)target; if (ThryActionEditor.MakeSureItsAnUdonBehaviour(action) == false) { return; } if (isNotInit) { Init(); } EditorGUILayout.LabelField("<size=30><color=#f542da>Thry's Action Script</color></size>", new GUIStyle(EditorStyles.label) { richText = true, alignment = TextAnchor.MiddleCenter }, GUILayout.Height(50)); //____________Behaviour__________ EditorGUILayout.LabelField("Behaviour", EditorStyles.boldLabel); EditorGUI.BeginChangeCheck(); behaviourType = (SpecialBehaviourType)EditorGUILayout.EnumPopup("Special Behaviour", (SpecialBehaviourType)action.specialActionType); if (behaviourType == SpecialBehaviourType.Normal) { actionType = (ActionType)EditorGUILayout.EnumPopup("Type", (ActionType)action.actionType); } if (EditorGUI.EndChangeCheck()) { Undo.RecordObject(action, "Modify Type"); action.actionType = (int)actionType; action.specialActionType = (int)behaviourType; } if (behaviourType == SpecialBehaviourType.Normal) { if (actionType == ActionType.Bool) { action.local_bool = EditorGUILayout.Toggle("Boolean", action.local_bool); } else if (actionType == ActionType.Float) { action.local_float = EditorGUILayout.FloatField("Float", action.local_float); } } if (showClapperGUI) { ClapperGUI(); } GUISyncing(); //__________Other UI____________ if (behaviourType == SpecialBehaviourType.MirrorManager) { MirrorMangerGUI(); } else { NormalGUI(); } UdonSharpEditorUtility.CopyProxyToUdon(action); serializedObject.ApplyModifiedProperties(); }