private void DrawEventsPanel() { TSSEditorUtils.DrawGenericProperty(ref core.useInput, "Precess input", core); TSSEditorUtils.DrawGenericProperty(ref core.useEvents, "Use events", core); if (!core.useEvents) { return; } toolBarEventsID2 = GUILayout.Toolbar(toolBarEventsID2, toolBarEventsTitle2); EditorGUILayout.BeginVertical(); if (toolBarEventsID2 == 0 || toolBarEventsID2 == 5) { EditorGUILayout.PropertyField(serializedCore.FindProperty("OnStateSelected")); } if (toolBarEventsID2 == 1 || toolBarEventsID2 == 5) { EditorGUILayout.PropertyField(serializedCore.FindProperty("OnFirstStateSelected")); } if (toolBarEventsID2 == 2 || toolBarEventsID2 == 5) { EditorGUILayout.PropertyField(serializedCore.FindProperty("OnLastStateSelected")); } if (toolBarEventsID2 == 3 || toolBarEventsID2 == 5) { EditorGUILayout.PropertyField(serializedCore.FindProperty("OnIncorrectStateSelected")); } if (toolBarEventsID2 == 4 || toolBarEventsID2 == 5) { EditorGUILayout.PropertyField(serializedCore.FindProperty("OnCurrentStatedClosed")); } EditorGUILayout.EndVertical(); }
private void DrawModesGUI() { EditorGUI.BeginChangeCheck(); GUILayout.Space(4); TSSEditorUtils.DrawGenericProperty(ref syncJoints, syncJointsContent); bool loopMode = path.loop; TSSEditorUtils.DrawGenericProperty(ref loopMode, loopModeContent, path.item); if (loopMode != path.loop) { path.loop = loopMode; selection.Clear(); } bool autoMode = path.auto; TSSEditorUtils.DrawGenericProperty(ref autoMode, autoModeContent, path.item); if (autoMode != path.auto) { path.auto = autoMode; selection.Clear(); } if (path.auto) { float pathSmooth = path.smoothFactor; TSSEditorUtils.DrawSliderProperty(ref pathSmooth, path.item, smoothFactorContent, 0, 1); if (pathSmooth != path.smoothFactor) { path.smoothFactor = pathSmooth; } } }
private void DrawEventsPanel() { if (Selection.transforms.Length > 1) { return; } EditorGUI.BeginDisabledGroup(Selection.transforms.Length > 1); GUILayout.Space(3); EditorGUILayout.BeginVertical(GUI.skin.box); foldOutEvents.target = EditorGUILayout.Foldout(foldOutEvents.target, " Events", true, GUI.skin.label); GUILayout.Space(3); if (foldOutEvents.faded > 0) { EditorGUILayout.BeginFadeGroup(foldOutEvents.faded); EditorGUILayout.BeginVertical(); toolBarEventsID = GUILayout.Toolbar(toolBarEventsID, toolBarEventsTitle); EditorGUILayout.BeginVertical(); if (toolBarEventsID == 0 || toolBarEventsID == 4) { TSSEditorUtils.DrawEventProperty(serializedItem.FindProperty("OnClosed"), item.OnClosed.GetPersistentEventCount()); } if (toolBarEventsID == 1 || toolBarEventsID == 4) { TSSEditorUtils.DrawEventProperty(serializedItem.FindProperty("OnOpening"), item.OnOpening.GetPersistentEventCount()); } if (toolBarEventsID == 2 || toolBarEventsID == 4) { TSSEditorUtils.DrawEventProperty(serializedItem.FindProperty("OnOpened"), item.OnOpened.GetPersistentEventCount()); } if (toolBarEventsID == 3 || toolBarEventsID == 4) { TSSEditorUtils.DrawEventProperty(serializedItem.FindProperty("OnClosing"), item.OnClosing.GetPersistentEventCount()); } EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical(); EditorGUILayout.EndFadeGroup(); } EditorGUILayout.EndVertical(); EditorGUI.EndDisabledGroup(); }
private void DrawStatesPanel() { EditorGUILayout.Space(); EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); foldOutStates.target = EditorGUILayout.Foldout(foldOutStates.target, string.Format(" States ({0})", core.Count), true, GUI.skin.label); if (GUILayout.Button(newStateButtonContent, TSSEditorUtils.max18pxWidth)) { AddState(); return; } EditorGUILayout.EndHorizontal(); if (foldOutStates.faded > 0) { EditorGUILayout.BeginFadeGroup(foldOutStates.faded); if (core.Count == 0) { EditorGUILayout.HelpBox(hlpBoxMessageNewState.text, MessageType.Info); } else { for (int i = 0; i < core.Count; i++) { if (!DrawState(core[i], i)) { break; } } } if (GUILayout.Button(newStateBigButtonContent)) { AddState(true); return; } EditorGUILayout.EndFadeGroup(); } EditorGUILayout.EndVertical(); EditorGUILayout.Space(); TSSEditorUtils.DrawGenericProperty(ref core.incorrectAction, "Incorrect Name Action", core); }
public void DrawAttachPointsPanel() { GUILayout.Space(3); EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); foldOutAttachPoints.target = EditorGUILayout.Foldout(foldOutAttachPoints.target, " Attach points", true, GUI.skin.label); EditorGUILayout.EndHorizontal(); GUILayout.Space(3); if (foldOutAttachPoints.faded > 0) { EditorGUILayout.BeginFadeGroup(foldOutAttachPoints.faded); for (int i = 0; i < path.pointsAttach.Count; i++) { EditorGUI.BeginDisabledGroup(!selection.Contains(i * 3)); Transform editingTransform = path.pointsAttach[i]; TSSEditorUtils.DrawGenericProperty(ref editingTransform, path); if (editingTransform != path.pointsAttach[i]) { path.pointsAttach[i] = editingTransform; } EditorGUI.EndDisabledGroup(); } EditorGUILayout.EndFadeGroup(); } EditorGUILayout.EndVertical(); GUILayout.Space(3); }
private void DrawAdvancedPanel() { GUILayout.Space(3); EditorGUILayout.BeginVertical(GUI.skin.box); foldOutAdvanced.target = EditorGUILayout.Foldout(foldOutAdvanced.target, " Advanced", true, GUI.skin.label); if (foldOutAdvanced.faded > 0) { EditorGUILayout.BeginFadeGroup(foldOutAdvanced.faded); GUILayout.Space(3); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; bool profilePropertyIdentical = ValuesIsIdentical(GetSelectedItemsValues <TSSProfile>("profile")); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "profile"); if (item.profile == null && profilePropertyIdentical && GUILayout.Button(TSSEditorUtils.addKeyButtonContent, TSSEditorUtils.max18pxWidth)) { item.profile = TSSProfileEditor.CreateProfileAsset(); TSSProfile.ProfileApply(item, item.profile); Selection.SetActiveObjectWithContext(item.gameObject, item); } if (item.profile != null && profilePropertyIdentical && GUILayout.Button(TSSEditorUtils.delKeyButtonContent, TSSEditorUtils.max18pxWidth)) { item.profile = null; } EditorGUILayout.EndHorizontal(); if (item.profile != null && profilePropertyIdentical) { EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(applyProfileButton)) { Undo.RecordObject(item.profile, "[TSS Item] applying profile"); TSSProfile.ProfileApply(item, item.profile); } if (GUILayout.Button(revertProfileButton)) { foreach (Transform itemTransform in Selection.transforms) { TSSItem item = itemTransform.GetComponent <TSSItem>(); if (item == null) { continue; } Undo.RecordObject(item, "[TSS Item] revert profile"); TSSProfile.ProfileRevert(item, item.profile); } } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "activationOpen"); DrawItemProperty(item, "activationClose"); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "activationStart"); EditorGUILayout.BeginVertical(); DrawItemProperty(item, "loops"); if (item.loops != 0 && ValuesIsIdentical(GetSelectedItemsValues <int>("loops"))) { DrawItemProperty(item, "loopMode", null, null, false, true); } EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "ignoreChilds"); DrawItemProperty(item, "ignoreParent"); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "rotationMode"); DrawItemProperty(item, "materialMode"); EditorGUILayout.EndHorizontal(); if (ValuesIsIdentical(GetSelectedItemsValues <RotationMode>("rotationMode")) && item.rotationMode == RotationMode.path) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(rotationMaskContent, GUILayout.MaxWidth(98)); DrawItemProperty(item, "rotationMaskX", "X", TSSEditorUtils.max18pxWidth); DrawItemProperty(item, "rotationMaskY", "Y", TSSEditorUtils.max18pxWidth); DrawItemProperty(item, "rotationMaskZ", "Z", TSSEditorUtils.max18pxWidth); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "pathNormal"); EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "interactions"); DrawItemProperty(item, "blockRaycasting"); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.BeginVertical(); DrawItemProperty(item, "soundControl"); if (item.soundControl && ValuesIsIdentical(GetSelectedItemsValues <bool>("soundControl"))) { DrawItemProperty(item, "soundRestart"); } EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(); DrawItemProperty(item, "videoControl"); if (item.videoControl && ValuesIsIdentical(GetSelectedItemsValues <bool>("videoControl"))) { DrawItemProperty(item, "videoRestart"); } EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); if (item.text != null) { TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "randomWave"); string floatFormat = item.floatFormat; DrawItemProperty(item, "floatFormat"); if (floatFormat != item.floatFormat) { try { 0f.ToString(item.floatFormat); } catch { Debug.LogWarningFormat("TSS Item \"{0}({1})\" has uncorrect float format!", item.name, item.GetInstanceID()); item.floatFormat = floatFormat; } } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); } if (item.button != null || (item.parent != null && item.parent.button != null && item.tweens.Where(t => t.enabled && t.direction == TweenDirection.Button).ToArray().Length > 0)) { TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "buttonDuration"); DrawItemProperty(item, "buttonDirection"); EditorGUILayout.EndHorizontal(); if (item.button != null && Selection.transforms.Length == 1) { TSSEditorUtils.DrawKeyCodeListProperty(item.values.onKeyboard, item, serializedItem.FindProperty("values").FindPropertyRelative("onKeyboard"), false); } EditorGUILayout.EndVertical(); } TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); DrawItemProperty(item, "updatingType"); DrawItemProperty(item, "timeScaled", null, GUILayout.MaxWidth(80), true); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); EditorGUILayout.EndFadeGroup(); } EditorGUILayout.EndVertical(); }
private void DrawStateItems(TSSState state) { EditorGUILayout.BeginHorizontal(); if (state.overrideModes) { EditorGUILayout.LabelField(propertyItem, TSSEditorUtils.max120pxWidth); TSSEditorUtils.DrawGenericProperty(ref state.modeOpenOverride, TSSEditorUtils.greenColor, core); TSSEditorUtils.DrawGenericProperty(ref state.modeCloseOverride, TSSEditorUtils.redColor, core); } else { EditorGUILayout.LabelField(propertyItem); } TSSEditorUtils.DrawGenericProperty(ref state.overrideModes, core); if (GUILayout.Button(addItemButtonContent, TSSEditorUtils.max18pxWidth, TSSEditorUtils.fixedLineHeight)) { Undo.RecordObject(core, "[TSS Core] add new item"); state.AddItem(null); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical(); GUI.backgroundColor = Color.white; for (int i = 0; i < state.Count; i++) { EditorGUILayout.BeginVertical(EditorStyles.helpBox); EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref state[i].enabled, core); EditorGUI.BeginDisabledGroup(!state[i].enabled); TSSEditorUtils.DrawGenericProperty(ref state[i].item, core); if (state[i].item != null && !state.overrideModes) { TSSEditorUtils.DrawGenericProperty(ref state[i].overrideModes, core); } EditorGUI.EndDisabledGroup(); if (GUILayout.Button(delItemButtonContent, TSSEditorUtils.max18pxWidth, TSSEditorUtils.fixedLineHeight)) { Undo.RecordObject(core, "[TSS Core] remove item"); state.RemoveItem(i); return; } EditorGUILayout.EndHorizontal(); EditorGUI.BeginDisabledGroup(!state[i].enabled); EditorGUILayout.BeginHorizontal(); if (!state.overrideModes && state[i].overrideModes && state[i].item != null) { TSSEditorUtils.DrawGenericProperty(ref state[i].mode[1], TSSEditorUtils.greenColor, core); TSSEditorUtils.DrawGenericProperty(ref state[i].mode[0], TSSEditorUtils.redColor, core); } EditorGUILayout.EndHorizontal(); EditorGUI.EndDisabledGroup(); EditorGUILayout.EndVertical(); } EditorGUILayout.EndVertical(); }
private bool DrawState(TSSState state, int stateID) { if (state == null) { return(false); } EditorGUILayout.BeginVertical(); TSSEditorUtils.BeginBlackVertical(); EditorGUILayout.BeginHorizontal(); bool isStateEnabled = state.enabled; TSSEditorUtils.DrawGenericProperty(ref isStateEnabled, core); if (core.currentState == state && state.enabled && !isStateEnabled) { if (Application.isPlaying) { state.Close(); } else { state.ActivateManualy(ActivationMode.closeBranchImmediately); } core.currentState = null; } state.enabled = isStateEnabled; EditorGUI.BeginDisabledGroup(!state.enabled); state.editing = EditorGUILayout.Foldout(state.editing, string.Format(" {0} {1}", state.name, state == core.defaultState ? " (default)" : string.Empty), true, stateFoldAutStyle); if (state != core.defaultState && GUILayout.Button(stateSetDefault, TSSEditorUtils.max80pxWidth, TSSEditorUtils.fixedLineHeight)) { Undo.RecordObject(core, "[TSS Core] default state"); core.SetDefaultState(state); } else if (state == core.defaultState && GUILayout.Button(stateUnsetDefault, TSSEditorUtils.max80pxWidth, TSSEditorUtils.fixedLineHeight)) { Undo.RecordObject(core, "[TSS Core] default state"); core.SetDefaultState(); } if (core.currentState == state) { GUI.color = TSSEditorUtils.greenColor; } if (GUILayout.Button(stateSelect, TSSEditorUtils.max50pxWidth, TSSEditorUtils.fixedLineHeight)) { SelectState(state); } GUI.color = Color.white; EditorGUI.EndDisabledGroup(); if (DrawStateDeleteButton(state)) { return(false); } EditorGUILayout.EndHorizontal(); EditorGUI.BeginDisabledGroup(!state.enabled); if (state.editing) { TSSEditorUtils.DrawGenericProperty(ref state.name, "State Name", core); TSSEditorUtils.DrawSeparator(); DrawStateItems(state); TSSEditorUtils.DrawSeparator(); TSSEditorUtils.DrawEventProperty(statesProperty.GetArrayElementAtIndex(stateID), "onOpen", state.onOpen.GetPersistentEventCount()); GUILayout.Space(3); TSSEditorUtils.DrawEventProperty(statesProperty.GetArrayElementAtIndex(stateID), "onClose", state.onClose.GetPersistentEventCount()); if (core.useInput) { TSSEditorUtils.DrawSeparator(); TSSEditorUtils.DrawKeyCodeListProperty(state.onKeyboard, core, statesProperty.GetArrayElementAtIndex(stateID).FindPropertyRelative("onKeyboard"), false); } } EditorGUI.EndDisabledGroup(); EditorGUILayout.EndVertical(); EditorGUILayout.EndVertical(); GUILayout.Space(3); return(true); }
public static TSSProfile CreateProfileAsset() { return(TSSEditorUtils.CreateAsset <TSSProfile>("New TSS Profile")); }
private void DrawValuesPanel() { GUILayout.Space(3); EditorGUILayout.BeginVertical(GUI.skin.box); EditorGUILayout.BeginHorizontal(); foldOutValues.target = EditorGUILayout.Foldout(foldOutValues.target, " Values", true, GUI.skin.label); EditorGUILayout.EndHorizontal(); if (foldOutValues.faded > 0) { EditorGUILayout.BeginFadeGroup(foldOutValues.faded); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Start activation", TSSEditorUtils.max120pxWidth); profile.values.startAction = (ActivationMode)EditorGUILayout.EnumPopup(profile.values.startAction); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Activation modes", TSSEditorUtils.max120pxWidth); profile.values.activations[0] = (ActivationMode)EditorGUILayout.EnumPopup(profile.values.activations[0]); profile.values.activations[1] = (ActivationMode)EditorGUILayout.EnumPopup(profile.values.activations[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Delays", TSSEditorUtils.max120pxWidth); profile.values.delays[0] = EditorGUILayout.FloatField(profile.values.delays[0]); profile.values.delays[1] = EditorGUILayout.FloatField(profile.values.delays[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Durations", TSSEditorUtils.max120pxWidth); profile.values.durations[0] = EditorGUILayout.FloatField(profile.values.durations[0]); profile.values.durations[1] = EditorGUILayout.FloatField(profile.values.durations[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Childs before", TSSEditorUtils.max120pxWidth); profile.values.childBefore[0] = EditorGUILayout.Toggle(profile.values.childBefore[0]); profile.values.childBefore[1] = EditorGUILayout.Toggle(profile.values.childBefore[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Chain delays", TSSEditorUtils.max120pxWidth); profile.values.chainDelays[0] = EditorGUILayout.FloatField(profile.values.chainDelays[0]); profile.values.chainDelays[1] = EditorGUILayout.FloatField(profile.values.chainDelays[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Chain first child delays", TSSEditorUtils.max120pxWidth); profile.values.firstChildDelay[0] = EditorGUILayout.FloatField(profile.values.firstChildDelay[0]); profile.values.firstChildDelay[1] = EditorGUILayout.FloatField(profile.values.firstChildDelay[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Chain directions", TSSEditorUtils.max120pxWidth); profile.values.chainDirections[0] = (ChainDirection)EditorGUILayout.EnumPopup(profile.values.chainDirections[0]); profile.values.chainDirections[1] = (ChainDirection)EditorGUILayout.EnumPopup(profile.values.chainDirections[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Rotation mode", TSSEditorUtils.max120pxWidth); profile.values.rotationMode = (RotationMode)EditorGUILayout.EnumPopup(profile.values.rotationMode); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Rotation mask", TSSEditorUtils.max120pxWidth); profile.values.rotationMask = EditorGUILayout.Vector3Field(string.Empty, profile.values.rotationMask); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Material mode", TSSEditorUtils.max120pxWidth); profile.values.materialMode = (MaterialMode)EditorGUILayout.EnumPopup(profile.values.materialMode); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Chain mode", TSSEditorUtils.max120pxWidth); profile.values.childChainMode = EditorGUILayout.Toggle(profile.values.childChainMode); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Ignore childs", TSSEditorUtils.max120pxWidth); profile.values.ignoreChilds = EditorGUILayout.Toggle(profile.values.ignoreChilds); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Ignore parent", TSSEditorUtils.max120pxWidth); profile.values.ignoreParent = EditorGUILayout.Toggle(profile.values.ignoreParent); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Break chain delays", TSSEditorUtils.max120pxWidth); profile.values.brakeChainDelay = EditorGUILayout.Toggle(profile.values.brakeChainDelay); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Interactions", TSSEditorUtils.max120pxWidth); profile.values.interactions = EditorGUILayout.Toggle(profile.values.interactions); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Block raycastring", TSSEditorUtils.max120pxWidth); profile.values.blockRaycasting = EditorGUILayout.Toggle(profile.values.blockRaycasting); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Sound control", TSSEditorUtils.max120pxWidth); profile.values.soundControl = EditorGUILayout.Toggle(profile.values.soundControl); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Sound restart", TSSEditorUtils.max120pxWidth); profile.values.soundRestart = EditorGUILayout.Toggle(profile.values.soundRestart); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Video control", TSSEditorUtils.max120pxWidth); profile.values.videoControl = EditorGUILayout.Toggle(profile.values.videoControl); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Video restart", TSSEditorUtils.max120pxWidth); profile.values.videoRestart = EditorGUILayout.Toggle(profile.values.videoRestart); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Float format", TSSEditorUtils.max120pxWidth); profile.values.floatFormat = EditorGUILayout.TextField(profile.values.floatFormat); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Text typing wave", TSSEditorUtils.max120pxWidth); profile.values.randomWaveLength = EditorGUILayout.IntField(profile.values.randomWaveLength); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Button duration", TSSEditorUtils.max120pxWidth); profile.values.buttonDuration = EditorGUILayout.FloatField(profile.values.buttonDuration); EditorGUILayout.EndHorizontal(); TSSEditorUtils.DrawKeyCodeListProperty(profile.values.onKeyboard, profile, true); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Loops", TSSEditorUtils.max120pxWidth); profile.values.loops = EditorGUILayout.IntField(profile.values.loops); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Loop mode", TSSEditorUtils.max120pxWidth); profile.values.loopMode = (ActivationMode)EditorGUILayout.EnumPopup(profile.values.loopMode); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Positions", TSSEditorUtils.max120pxWidth); profile.values.positions[0] = EditorGUILayout.Vector3Field(string.Empty, profile.values.positions[0]); profile.values.positions[1] = EditorGUILayout.Vector3Field(string.Empty, profile.values.positions[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Quaternion", TSSEditorUtils.max120pxWidth); profile.values.rotations[0] = Quaternion.Euler(EditorGUILayout.Vector3Field("", profile.values.rotations[0].eulerAngles)); profile.values.rotations[1] = Quaternion.Euler(EditorGUILayout.Vector3Field("", profile.values.rotations[1].eulerAngles)); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Euler angles", TSSEditorUtils.max120pxWidth); profile.values.eulerRotations[0] = EditorGUILayout.Vector3Field(string.Empty, profile.values.eulerRotations[0]); profile.values.eulerRotations[1] = EditorGUILayout.Vector3Field(string.Empty, profile.values.eulerRotations[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Scales", TSSEditorUtils.max120pxWidth); profile.values.scales[0] = EditorGUILayout.Vector3Field(string.Empty, profile.values.scales[0]); profile.values.scales[1] = EditorGUILayout.Vector3Field(string.Empty, profile.values.scales[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Colors", TSSEditorUtils.max120pxWidth); profile.values.colors[0] = EditorGUILayout.ColorField("", profile.values.colors[0]); profile.values.colors[1] = EditorGUILayout.ColorField("", profile.values.colors[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Alphas", TSSEditorUtils.max120pxWidth); profile.values.alphas[0] = EditorGUILayout.FloatField(profile.values.alphas[0]); profile.values.alphas[1] = EditorGUILayout.FloatField(profile.values.alphas[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Image fillings", TSSEditorUtils.max120pxWidth); profile.values.imageFills[0] = EditorGUILayout.FloatField(profile.values.imageFills[0]); profile.values.imageFills[1] = EditorGUILayout.FloatField(profile.values.imageFills[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Numbers", TSSEditorUtils.max120pxWidth); profile.values.numbers[0] = EditorGUILayout.FloatField(profile.values.numbers[0]); profile.values.numbers[1] = EditorGUILayout.FloatField(profile.values.numbers[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Texts", TSSEditorUtils.max120pxWidth); profile.values.texts[0] = EditorGUILayout.TextArea(profile.values.texts[0]); profile.values.texts[1] = EditorGUILayout.TextArea(profile.values.texts[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Rects", TSSEditorUtils.max120pxWidth); profile.values.rects[0] = EditorGUILayout.Vector4Field("", profile.values.rects[0]); profile.values.rects[1] = EditorGUILayout.Vector4Field("", profile.values.rects[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Anchors", TSSEditorUtils.max120pxWidth); profile.values.anchors[0] = EditorGUILayout.Vector4Field("", profile.values.anchors[0]); profile.values.anchors[1] = EditorGUILayout.Vector4Field("", profile.values.anchors[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Anchors positions", TSSEditorUtils.max120pxWidth); profile.values.anchorPositions[0] = EditorGUILayout.Vector2Field("", profile.values.anchorPositions[0]); profile.values.anchorPositions[1] = EditorGUILayout.Vector2Field("", profile.values.anchorPositions[1]); EditorGUILayout.EndVertical(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Intensities", TSSEditorUtils.max120pxWidth); profile.values.intensities[0] = EditorGUILayout.FloatField(profile.values.intensities[0]); profile.values.intensities[1] = EditorGUILayout.FloatField(profile.values.intensities[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Light ranges", TSSEditorUtils.max120pxWidth); profile.values.lightRange[0] = EditorGUILayout.FloatField(profile.values.lightRange[0]); profile.values.lightRange[1] = EditorGUILayout.FloatField(profile.values.lightRange[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Sound ranges", TSSEditorUtils.max120pxWidth); profile.values.soundRange[0] = EditorGUILayout.FloatField(profile.values.soundRange[0]); profile.values.soundRange[1] = EditorGUILayout.FloatField(profile.values.soundRange[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Collider range", TSSEditorUtils.max120pxWidth); profile.values.sphereRange[0] = EditorGUILayout.FloatField(profile.values.sphereRange[0]); profile.values.sphereRange[1] = EditorGUILayout.FloatField(profile.values.sphereRange[1]); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Updating type", TSSEditorUtils.max120pxWidth); profile.values.updatingType = (ItemUpdateType)EditorGUILayout.EnumPopup(profile.values.updatingType); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Time scaling", TSSEditorUtils.max120pxWidth); profile.values.timeScaled = EditorGUILayout.Toggle(profile.values.timeScaled); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Path loop mode", TSSEditorUtils.max120pxWidth); profile.values.pathIsLooped = EditorGUILayout.Toggle(profile.values.pathIsLooped); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Path auto control", TSSEditorUtils.max120pxWidth); profile.values.pathAutoControl = EditorGUILayout.Toggle(profile.values.pathAutoControl); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Path smoothing", TSSEditorUtils.max120pxWidth); profile.values.pathSmoothFactor = EditorGUILayout.FloatField(profile.values.pathSmoothFactor); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Path resolution", TSSEditorUtils.max120pxWidth); profile.values.pathResolution = EditorGUILayout.IntField(profile.values.pathResolution); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Path spacing", TSSEditorUtils.max120pxWidth); profile.values.pathSpacing = EditorGUILayout.IntField(profile.values.pathSpacing); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Path normal", TSSEditorUtils.max120pxWidth); profile.values.pathNormal = (PathNormal)EditorGUILayout.EnumPopup(profile.values.pathNormal); EditorGUILayout.EndHorizontal(); GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.LabelField("Path lerping", TSSEditorUtils.max120pxWidth); profile.values.pathLerpMode = (PathLerpMode)EditorGUILayout.EnumPopup(profile.values.pathLerpMode); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndFadeGroup(); } EditorGUILayout.EndVertical(); }
private void Awake() { previewMesh = TSSEditorUtils.LoadAssetFromUniqueAssetPath <Mesh>("Library/unity default resources::Cube"); previewMaterial = AssetDatabase.GetBuiltinExtraResource <Material>("Default-Diffuse.mat"); previewUIMaterial = AssetDatabase.GetBuiltinExtraResource <Material>("Sprites-Default.mat"); }
private static bool DrawTween(TSSTween tween, List <TSSTween> holder, Object parent, TSSItemValues values) { GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f); EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); GUI.backgroundColor = Color.white; EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref tween.enabled, parent); EditorGUI.BeginDisabledGroup(!tween.enabled); ItemEffect tweenEffect = tween.effect; TSSEditorUtils.DrawGenericProperty(ref tween.effect, parent); if (tween.effect != tweenEffect) { if (tween.effect == ItemEffect.property) { tween.matProperty = new TSSMaterialProperty(MaterialPropertyType.single); } if (tween.effect != ItemEffect.property) { tween.matProperty = null; tween.matPropertyType = MaterialPropertyType.single; } } EditorGUI.BeginDisabledGroup(tween.direction == TweenDirection.Button); if (tween.mode == TweenMode.Multiple) { EditorGUI.BeginDisabledGroup(tween.direction == TweenDirection.Close); TSSEditorUtils.DrawGenericProperty(ref tween.type, TSSEditorUtils.greenColor, null, parent); EditorGUI.EndDisabledGroup(); EditorGUI.BeginDisabledGroup(tween.direction == TweenDirection.Open); TSSEditorUtils.DrawGenericProperty(ref tween.closingType, TSSEditorUtils.redColor, null, parent); EditorGUI.EndDisabledGroup(); } else { TSSEditorUtils.DrawGenericProperty(ref tween.type, parent); } TSSEditorUtils.DrawGenericProperty(ref tween.mode, parent); EditorGUI.EndDisabledGroup(); TweenDirection tweenDirection = tween.direction; TSSEditorUtils.DrawGenericProperty(ref tween.direction, parent); if (tween.direction != tweenDirection) { if (tween.direction == TweenDirection.Button) { tween.type = TweenType.Custom; tween.mode = TweenMode.Single; } } EditorGUI.EndDisabledGroup(); if (DrawTweenDeleteButton(tween, holder, parent)) { return(false); } EditorGUILayout.EndHorizontal(); EditorGUI.BeginDisabledGroup(!tween.enabled); GUILayout.Space(3); TSSEditorUtils.DrawMinMaxSliderProperty(ref tween.startPoint, ref tween.endPoint, parent); if (tween.mode == TweenMode.Multiple && tween.direction == TweenDirection.OpenClose) { TSSEditorUtils.DrawSliderProperty(ref tween.blendFactor, parent, blndTweenLabelContent); } if ((tween.type == TweenType.Custom && tween.direction != TweenDirection.Close) || (tween.mode == TweenMode.Multiple && tween.closingType == TweenType.Custom && tween.direction != TweenDirection.Open)) { EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref tween.customEase, parent); EditorGUILayout.EndHorizontal(); } if (tween.effect == ItemEffect.property) { EditorGUILayout.BeginVertical(); EditorGUILayout.BeginHorizontal(); MaterialPropertyType tssMatPropType = tween.matPropertyType; string tssMatPropName = tween.matProperty.name; TSSEditorUtils.DrawGenericProperty(ref tween.matPropertyType, parent); if (tssMatPropType != tween.matPropertyType) { tween.matProperty = new TSSMaterialProperty(tween.matPropertyType); } tween.matProperty.name = tssMatPropName; TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.name, parent); EditorGUILayout.EndHorizontal(); switch (tween.matPropertyType) { case MaterialPropertyType.single: EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.singleValues[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.singleValues[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case MaterialPropertyType.integer: EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.integerValues[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.integerValues[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case MaterialPropertyType.color: TSSEditorUtils.useHDRcolors = false; EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.colorValues[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.colorValues[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case MaterialPropertyType.colorHDR: TSSEditorUtils.useHDRcolors = true; EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.colorValues[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.colorValues[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case MaterialPropertyType.vector2: TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.vector2values[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.vector2values[1], TSSEditorUtils.greenColor, parent); break; case MaterialPropertyType.vector3: TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.vector3values[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.vector3values[1], TSSEditorUtils.greenColor, parent); break; case MaterialPropertyType.vector4: TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.vector4values[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.vector4values[1], TSSEditorUtils.greenColor, parent); break; case MaterialPropertyType.curve: TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.curve, parent); break; case MaterialPropertyType.gradient: TSSEditorUtils.DrawGenericProperty(ref tween.matProperty.gradient, parent); break; } EditorGUILayout.EndVertical(); } if (TSSPrefsEditor.showTweenProperties) { EditorGUILayout.BeginVertical(); switch (tween.effect) { case ItemEffect.transform: EditorGUILayout.LabelField("Position"); EditorGUILayout.BeginVertical(); TSSEditorUtils.DrawGenericProperty(ref values.positions[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.positions[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndVertical(); GUILayout.Space(4); EditorGUILayout.LabelField("Rotation"); EditorGUILayout.BeginVertical(); TSSEditorUtils.DrawGenericProperty(ref values.eulerRotations[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.eulerRotations[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndVertical(); GUILayout.Space(4); EditorGUILayout.LabelField("Scale"); EditorGUILayout.BeginVertical(); TSSEditorUtils.DrawGenericProperty(ref values.scales[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.scales[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndVertical(); break; case ItemEffect.position: TSSEditorUtils.DrawGenericProperty(ref values.positions[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.positions[1], TSSEditorUtils.greenColor, parent); break; case ItemEffect.rotation: TSSEditorUtils.DrawGenericProperty(ref values.eulerRotations[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.eulerRotations[1], TSSEditorUtils.greenColor, parent); break; case ItemEffect.scale: TSSEditorUtils.DrawGenericProperty(ref values.scales[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.scales[1], TSSEditorUtils.greenColor, parent); break; case ItemEffect.directAlpha: EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref values.alphas[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.alphas[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case ItemEffect.alpha: EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref values.alphas[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.alphas[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case ItemEffect.color: EditorGUILayout.BeginHorizontal(); TSSEditorUtils.useHDRcolors = false; TSSEditorUtils.DrawGenericProperty(ref values.colors[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.colors[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case ItemEffect.imageFill: EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref values.imageFills[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.imageFills[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case ItemEffect.text: TSSEditorUtils.DrawGenericProperty(ref values.texts[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.texts[1], TSSEditorUtils.greenColor, parent); break; case ItemEffect.number: EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref values.numbers[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.numbers[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case ItemEffect.light: EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Color", TSSEditorUtils.max80pxWidth); TSSEditorUtils.DrawGenericProperty(ref values.colors[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.colors[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); GUILayout.Space(4); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Intensity", TSSEditorUtils.max80pxWidth); TSSEditorUtils.DrawGenericProperty(ref values.intensities[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.intensities[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); GUILayout.Space(4); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Range", TSSEditorUtils.max80pxWidth); TSSEditorUtils.DrawGenericProperty(ref values.lightRange[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.lightRange[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; case ItemEffect.range: EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Light", TSSEditorUtils.max80pxWidth); TSSEditorUtils.DrawGenericProperty(ref values.lightRange[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.lightRange[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); GUILayout.Space(4); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Collider", TSSEditorUtils.max80pxWidth); TSSEditorUtils.DrawGenericProperty(ref values.sphereRange[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.sphereRange[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); GUILayout.Space(4); EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Sound", TSSEditorUtils.max80pxWidth); TSSEditorUtils.DrawGenericProperty(ref values.soundRange[0], TSSEditorUtils.redColor, parent); TSSEditorUtils.DrawGenericProperty(ref values.soundRange[1], TSSEditorUtils.greenColor, parent); EditorGUILayout.EndHorizontal(); break; } EditorGUILayout.EndVertical(); } EditorGUI.EndDisabledGroup(); EditorGUILayout.EndVertical(); EditorGUILayout.EndHorizontal(); GUILayout.Space(3); return(true); }
private void DrawLerpGUI() { bool isLinearLerp = path.item.values.pathLerpMode == PathLerpMode.baked; if (isLinearLerp) { EditorGUILayout.BeginVertical(EditorStyles.helpBox); } EditorGUILayout.BeginHorizontal(); TSSEditorUtils.DrawGenericProperty(ref path.item.values.pathLerpMode, lerpModeContent, path.item); if (isLinearLerp && path.item.values.pathLerpMode == PathLerpMode.dynamic) { Undo.RecordObjects(new Object[] { path, path.item }, "[TSS Path] Delete segments"); path.pointsAttach = new List <Transform>(); path.pointsAttach.AddRange(new Transform[path.segmentsCount + 1]); } if (!isLinearLerp && path.item.values.pathLerpMode == PathLerpMode.baked) { Undo.RecordObjects(new Object[] { path, path.item }, "[TSS Path] Split segment"); path.pointsAttach = null; path.UpdateSpacedPoints(); } if (isLinearLerp && GUILayout.Button(bakeButtonContent, TSSEditorUtils.max80pxWidth, TSSEditorUtils.fixedLineHeight)) { path.UpdateSpacedPoints(); } EditorGUILayout.EndHorizontal(); if (isLinearLerp) { GUILayout.Space(4); float pathSpacing = path.spacing; TSSEditorUtils.DrawSliderProperty(ref pathSpacing, path.item, qualitySpacingContent, 2, 100); if (pathSpacing != path.spacing) { path.spacing = Mathf.CeilToInt(pathSpacing); } ; float pathResolution = path.resolution; TSSEditorUtils.DrawSliderProperty(ref pathResolution, path.item, qualityResolutionContent, 1, 10); if (pathResolution != path.resolution) { path.resolution = Mathf.CeilToInt(pathResolution); } } if (isLinearLerp) { EditorGUILayout.EndVertical(); } }