void DrawListenSelector() { if (triggerOnGameEvent.boolValue || triggerOnButtonClick.boolValue || triggerOnButtonDoubleClick.boolValue || triggerOnButtonLongClick.boolValue) { return; } SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.BlueLight.Color); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Listen for", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 58); QUI.Space(SPACE_4); QUI.PropertyField(triggerOnGameEvent, 12); QUI.Label("game event", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 72); QUI.Space(SPACE_4); QUI.PropertyField(triggerOnButtonClick, 12); QUI.Label("button click", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 68); QUI.Space(SPACE_4); QUI.PropertyField(triggerOnButtonDoubleClick, 12); QUI.Label("double click", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 70); QUI.Space(SPACE_4); QUI.PropertyField(triggerOnButtonLongClick, 12); QUI.Label("long click", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 64); } QUI.EndHorizontal(); RestoreColors(); }
public static void DrawUnityEvents(bool enabled, AnimBool showEvents, SerializedProperty unityEvent, string unityEventTitle, float width, float miniBarHeight) { if (QUI.GhostBar("Unity Events", enabled ? QColors.Color.Blue : QColors.Color.Gray, showEvents, width, miniBarHeight)) { showEvents.target = !showEvents.target; } QUI.BeginHorizontal(width); { QUI.Space(8 * showEvents.faded); if (QUI.BeginFadeGroup(showEvents.faded)) { QUI.SetGUIBackgroundColor(enabled ? AccentColorBlue : AccentColorGray); QUI.BeginVertical(width - 16); { QUI.Space(2 * showEvents.faded); QUI.PropertyField(unityEvent, new GUIContent() { text = unityEventTitle }, width - 8); QUI.Space(2 * showEvents.faded); } QUI.EndVertical(); QUI.ResetColors(); } QUI.EndFadeGroup(); } QUI.EndHorizontal(); }
void DrawSettings(float width) { QUI.Space(SPACE_2); QUI.BeginHorizontal(width); { QUI.QToggle("play on awake", playOnAwake, 20); QUI.FlexibleSpace(); QUI.QToggle("stop instantly on hide", stopInstantly, 20); QUI.FlexibleSpace(); QLabel.text = "start delay on show"; QLabel.style = Style.Text.Normal; QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, startDelay.floatValue != 0 ? QColors.Color.Blue : QColors.Color.Gray), 4 + QLabel.x + 40 + 16, 20); QUI.Space(-(QLabel.x + 40 + 16)); QUI.BeginVertical(QLabel.x, QUI.SingleLineHeight); { QUI.Space(1); QUI.Label(QLabel); } QUI.EndVertical(); QUI.PropertyField(startDelay, 40); QUI.Space(SPACE_4); } QUI.EndHorizontal(); }
void DrawTargetParticleSystem(float width) { QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, uiEffect.targetParticleSystem == null ? QColors.Color.Red : QColors.Color.Blue), width, 20); QUI.Space(-20); QLabel.text = "Target ParticleSystem"; QLabel.style = Style.Text.Normal; QUI.BeginHorizontal(width); { QUI.Space(SPACE_4); QUI.BeginVertical(QLabel.x, QUI.SingleLineHeight); { QUI.Label(QLabel); QUI.Space(1); } QUI.EndVertical(); QUI.PropertyField(targetParticleSystem, width - QLabel.x - 20); QUI.FlexibleSpace(); QUI.Space(SPACE_8); } QUI.EndHorizontal(); infoMessage["ParticleSystemDisabled"].show.target = uiEffect.targetParticleSystem == null; DrawInfoMessage("ParticleSystemDisabled", GlobalWidth); QUI.Space(SPACE_4 * infoMessage["ParticleSystemDisabled"].show.faded); }
void DrawGameEventOptions() { if (!triggerOnGameEvent.boolValue) { return; } buttonCategory.stringValue = DUI.DEFAULT_CATEGORY_NAME; buttonName.stringValue = DUI.DEFAULT_BUTTON_NAME; ValiateUIButtonNameAndCategory(); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.BlueLight.Color); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Listen for", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 58); QUI.PropertyField(triggerOnGameEvent, 12); QUI.Label("game event", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 70); QUI.Space(SPACE_8); QUI.PropertyField(dispatchAll, 12); QUI.Label("dispatch all", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 142); } QUI.EndHorizontal(); if (dispatchAll.boolValue) { gameEvent.stringValue = ""; return; } QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Game Event", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 72); EditorGUILayout.DelayedTextField(gameEvent, GUIContent.none, GUILayout.Width(344)); } QUI.EndHorizontal(); RestoreColors(); }
void DrawOrientation() { QUI.Space(-SPACE_4); switch (orientationManager.CurrentOrientation) { case OrientationManager.Orientation.Landscape: if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ButtonStyle.OrientationLandscape), 420, 28)) { UpdateOrientationInEditMode(); } break; case OrientationManager.Orientation.Portrait: if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ButtonStyle.OrientationPortrait), 420, 28)) { UpdateOrientationInEditMode(); } break; case OrientationManager.Orientation.Unknown: if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ButtonStyle.OrientationUnknown), 420, 28)) { UpdateOrientationInEditMode(); } break; } QUI.Space(SPACE_2); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.PurpleLight.Color); QUI.PropertyField(onOrientationChange, true, new GUIContent("OnOrientationChange"), WIDTH_420); RestoreColors(); }
void DrawSortingLayerName() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Sorting Layer Name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 126); if (!useCustomSortingLayerName.boolValue) { targetSortingLayerName = TargetCanvas.overrideSorting ? TargetCanvas.sortingLayerName : TargetCanvas.rootCanvas.sortingLayerName; QUI.Label(targetSortingLayerName, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormalItalic), 140); QUI.Toggle(useCustomSortingLayerName); QUI.Label("use a custom layer name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 200); customSortingLayerName.stringValue = targetSortingLayerName; } else { if (customSortingLayerName.stringValue == MISSING_UIELEMENT) { customSortingLayerName.stringValue = "Default"; } QUI.PropertyField(customSortingLayerName, 140); QUI.Toggle(useCustomSortingLayerName); QUI.Label("use a custom layer name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 200); } } QUI.EndHorizontal(); QUI.Space(SPACE_2); }
void DrawOrientation(float width) { QStyles.GetStyle(QStyles.GetStyleName(Style.GhostButton.Purple)).alignment = TextAnchor.MiddleRight; if (QUI.GhostButton("update orientation", QColors.Color.Purple, width, 32, 10)) { UpdateOrientationInEditMode(); } QStyles.GetStyle(QStyles.GetStyleName(Style.GhostButton.Purple)).alignment = TextAnchor.MiddleCenter; QUI.Space(-32); switch (orientationManager.CurrentOrientation) { case OrientationManager.Orientation.Landscape: QUI.DrawTexture(DUIResources.miniIconOrientationLandscape.texture, 160, 32); break; case OrientationManager.Orientation.Portrait: QUI.DrawTexture(DUIResources.miniIconOrientationPortrait.texture, 160, 32); break; case OrientationManager.Orientation.Unknown: QUI.DrawTexture(DUIResources.miniIconOrientationUnknown.texture, 160, 32); break; } QUI.Space(SPACE_2); QUI.SetGUIBackgroundColor(QUI.AccentColorPurple); QUI.PropertyField(onOrientationChange, true, new GUIContent("OnOrientationChange"), width); QUI.ResetColors(); }
void DrawPair(string title, string firstLabel, SerializedProperty firstProperty, string firstDefaultValue, string secondLabel, SerializedProperty secondProperty, string secondDefaultValue, float width, bool isSingle = false) { QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, QColors.Color.Purple), width, 18); QUI.Space(-18); QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, QColors.Color.Purple), width, isSingle ? 42 : 60); QUI.Space(isSingle ? -44 : -62); QLabel.text = title; QLabel.style = Style.Text.Normal; QUI.BeginHorizontal(width); { QUI.Space(6); QUI.Label(QLabel); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_2); QUI.BeginHorizontal(width); { QUI.Space(12); QLabel.text = firstLabel; QLabel.style = Style.Text.Small; QUI.Label(QLabel); QUI.PropertyField(firstProperty); if (QUI.ButtonReset()) { firstProperty.stringValue = firstDefaultValue; } QUI.Space(6); } QUI.EndHorizontal(); if (isSingle) { return; } QUI.BeginHorizontal(width); { QUI.Space(12); QLabel.text = secondLabel; QLabel.style = Style.Text.Small; QUI.Label(QLabel); QUI.PropertyField(secondProperty); if (QUI.ButtonReset()) { secondProperty.stringValue = secondDefaultValue; } QUI.Space(6); } QUI.EndHorizontal(); }
void DrawTargetParticleSystem() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Target ParticleSystem", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 126); QUI.PropertyField(targetParticleSystem, 290); } QUI.EndHorizontal(); }
void DrawCloseButton() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Close Button", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 130); QUI.PropertyField(closeButton, 281); } QUI.EndHorizontal(); }
void DrawDontDestroyOnLoad() { QUI.BeginHorizontal(WIDTH_420); { QUI.PropertyField(dontDestroyOnLoad, 12); QUI.Label("Don't Destroy On Load", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_210); } QUI.EndHorizontal(); QUI.Space(SPACE_4); }
void DrawSortingLayerName(float width) { QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, useCustomSortingLayerName.boolValue ? QColors.Color.Blue : QColors.Color.Gray), width - 164, 20); QUI.Space(-20); QUI.BeginHorizontal(width); { QLabel.text = "Sorting Layer Name"; QLabel.style = Style.Text.Normal; tempFloat = QLabel.x; //save label width QUI.Space(SPACE_4); QUI.BeginVertical(QLabel.x, QUI.SingleLineHeight); { QUI.Space(1); QUI.Label(QLabel); } QUI.EndVertical(); if (!useCustomSortingLayerName.boolValue) { targetSortingLayerName = TargetCanvas.overrideSorting ? TargetCanvas.sortingLayerName : TargetCanvas.rootCanvas.sortingLayerName; QLabel.text = targetSortingLayerName; QLabel.style = Style.Text.Help; QUI.BeginVertical(width - tempFloat - 174, QUI.SingleLineHeight); { QUI.Space(2); QUI.Label(QLabel); } QUI.EndVertical(); customSortingLayerName.stringValue = targetSortingLayerName; } else { if (customSortingLayerName.stringValue == MISSING_UIELEMENT) { customSortingLayerName.stringValue = "Default"; } QUI.PropertyField(customSortingLayerName, width - tempFloat - 184); QUI.Space(2); } QUI.QToggle("use a custom layer name", useCustomSortingLayerName, 20); } QUI.EndHorizontal(); QUI.Space(SPACE_2); }
public override void OnInspectorGUI() { serializedObject.Update(); switch (poolyDespawner.despawnAfter) { case PoolyDespawner.DespawnAfter.Time: DrawHeader(EZResources.editorHeaderPoolyDespawnerTime.texture, WIDTH_420, 42); DrawTime(); break; case PoolyDespawner.DespawnAfter.SoundPlayed: DrawHeader(EZResources.editorHeaderPoolyDespawnerSoundPlayed.texture, WIDTH_420, 42); useRealTime.boolValue = false; DrawSound(); break; case PoolyDespawner.DespawnAfter.EffectPlayed: DrawHeader(EZResources.editorHeaderPoolyDespawnerEffectPlayed.texture, WIDTH_420, 42); useRealTime.boolValue = false; DrawEffect(); break; case PoolyDespawner.DespawnAfter.Collision: DrawHeader(EZResources.editorHeaderPoolyDespawnerCollider.texture, WIDTH_420, 42); useRealTime.boolValue = false; DrawCollision(); break; case PoolyDespawner.DespawnAfter.Trigger: DrawHeader(EZResources.editorHeaderPoolyDespawnerTrigger.texture, WIDTH_420, 42); useRealTime.boolValue = false; DrawTrigger(); break; case PoolyDespawner.DespawnAfter.Collision2D: DrawHeader(EZResources.editorHeaderPoolyDespawnerCollider2D.texture, WIDTH_420, 42); useRealTime.boolValue = false; DrawCollision2D(); break; case PoolyDespawner.DespawnAfter.Trigger2D: DrawHeader(EZResources.editorHeaderPoolyDespawnerTrigger2D.texture, WIDTH_420, 42); useRealTime.boolValue = false; DrawTrigger2D(); break; } QUI.Space(SPACE_4); QUI.SetGUIBackgroundColor(accentColorPurple); QUI.PropertyField(OnDespawn, new GUIContent("OnDespawn"), WIDTH_420); QUI.ResetColors(); QUI.Space(SPACE_4); serializedObject.ApplyModifiedProperties(); QUI.Space(SPACE_4); }
void DrawCanvasName() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Canvas Name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_105); if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.Label(canvasName.stringValue, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormalItalic)); } else { if (customCanvasName.boolValue) { QUI.PropertyField(canvasName, 240); } else { QUI.BeginChangeCheck(); { if (DUI.CanvasNamesDatabase == null || !DUI.CanvasNamesDatabase.Contains(canvasName.stringValue)) { RefreshCanvasNames(true); } canvasNameIndex = EditorGUILayout.Popup(canvasNameIndex, DUI.CanvasNamesDatabase.ToArray(), GUILayout.Width(240)); } if (QUI.EndChangeCheck()) { canvasName.stringValue = DUI.CanvasNamesDatabase.data[canvasNameIndex]; } } QUI.Space(SPACE_4); QUI.BeginChangeCheck(); { QUI.PropertyField(customCanvasName, 12); } if (QUI.EndChangeCheck()) { if (!customCanvasName.boolValue) { ValidateUICanvasCanvasName(); } } QUI.Label("custom", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 50); } } QUI.EndHorizontal(); QUI.Space(SPACE_4); }
void DrawTargetUIElement() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Target UIElement", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 126); QUI.BeginChangeCheck(); { QUI.PropertyField(targetUIElement, 290); } if (QUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); RenameGameObject(); } } QUI.EndHorizontal(); QUI.Space(-SPACE_2); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(130); QUI.Label("Element Category", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 100); if (uiEffect.targetUIElement != null) { QUI.Label(uiEffect.targetUIElement.elementCategory, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmallItalic), 190); } else { QUI.Label(MISSING_UIELEMENT, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmallItalic), 190); } } QUI.EndHorizontal(); QUI.Space(-SPACE_4); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(130); QUI.Label("Element Name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 100); if (uiEffect.targetUIElement != null) { QUI.Label(uiEffect.targetUIElement.elementName, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmallItalic), 190); } else { QUI.Label(MISSING_UIELEMENT, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmallItalic), 190); } } QUI.EndHorizontal(); }
private void DrawSettings() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Master Volume", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 90); EditorGUILayout.Slider(masterVolume, 0, 1, GUIContent.none, GUILayout.Width(160)); QUI.Space(SPACE_4); QUI.Label("Sound Channels", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 100); QUI.PropertyField(numberOfChannels, 52); } QUI.EndHorizontal(); if (numberOfChannels.intValue < 1) { numberOfChannels.intValue = 1; } }
void DrawButtonNameOptions() { if (!triggerOnButtonClick.boolValue && !triggerOnButtonDoubleClick.boolValue && !triggerOnButtonLongClick.boolValue) { return; } gameEvent.stringValue = ""; DrawTopButtons(); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.BlueLight.Color); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Listen for", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 58); if (triggerOnButtonClick.boolValue) { QUI.PropertyField(triggerOnButtonClick, 12); QUI.Label("button click", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 68); } else if (triggerOnButtonDoubleClick.boolValue) { QUI.PropertyField(triggerOnButtonDoubleClick, 12); QUI.Label("double click", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 70); } else if (triggerOnButtonLongClick.boolValue) { QUI.PropertyField(triggerOnButtonLongClick, 12); QUI.Label("long click", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 64); } QUI.Space(SPACE_8); QUI.PropertyField(dispatchAll, 12); QUI.Label("dispatch all", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 142); } QUI.EndHorizontal(); if (dispatchAll.boolValue) { gameEvent.stringValue = ""; return; } DrawButtonCategory(); DrawButtonName(); RestoreColors(); }
void DrawSortingOrder() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Order in Layer", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 126); if (!useCustomOrderInLayer.boolValue) { targetOrderInLayer = TargetCanvas.overrideSorting ? TargetCanvas.sortingOrder : TargetCanvas.rootCanvas.sortingOrder; targetOrderInLayer = uiEffect.effectPosition == UIEffect.EffectPosition.InFrontOfTarget ? targetOrderInLayer + uiEffect.sortingOrderStep : targetOrderInLayer - uiEffect.sortingOrderStep; QUI.Label(targetOrderInLayer.ToString(), DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormalItalic), 140); QUI.Toggle(useCustomOrderInLayer); QUI.Label("use a custom order in layer", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 200); customOrderInLayer.intValue = targetOrderInLayer; } else { QUI.PropertyField(customOrderInLayer, 140); QUI.Toggle(useCustomOrderInLayer); QUI.Label("use a custom order in layer", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 200); } } QUI.EndHorizontal(); if (!useCustomOrderInLayer.boolValue) { QUI.BeginHorizontal(WIDTH_420); { QUI.Space(130); QUI.Label("Set the effect", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 68); QUI.PropertyField(effectPosition, 110); QUI.Label("by", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 16); QUI.PropertyField(sortingOrderStep, 40); QUI.Label("step" + (sortingOrderStep.intValue == 1 ? "" : "s"), DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 40); } QUI.EndHorizontal(); } QUI.Space(SPACE_2); }
void DrawIcon() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Notification Icon", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 130); QUI.BeginChangeCheck(); { QUI.PropertyField(icon, 281); } if (QUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); if (uiNotification.icon != null) { uiNotification.icon.name = "Notification Icon"; } } } QUI.EndHorizontal(); }
void DrawSettings() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("start delay on show", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 126); QUI.PropertyField(startDelay, 290); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Toggle(playOnAwake); QUI.Label("play on awake", 130); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Toggle(stopInstantly); QUI.Label("stop instantly on hide", 130); } QUI.EndHorizontal(); }
void DrawEvents() { if (!triggerOnGameEvent.boolValue && !triggerOnButtonClick.boolValue && !triggerOnButtonDoubleClick.boolValue && !triggerOnButtonLongClick.boolValue) { return; } if (triggerOnGameEvent.boolValue && (!dispatchAll.boolValue && string.IsNullOrEmpty(gameEvent.stringValue))) { return; } if ((triggerOnButtonClick.boolValue || triggerOnButtonDoubleClick.boolValue || triggerOnButtonLongClick.boolValue) && (!dispatchAll.boolValue && string.IsNullOrEmpty(buttonName.stringValue))) { return; } SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.BlueLight.Color); QUI.PropertyField(onTriggerEvent, new GUIContent("On Trigger Event"), WIDTH_420); RestoreColors(); QUI.ResetColors(); if (QUI.Button(DUIStyles.GetStyle(showGameEvents.target ? DUIStyles.ButtonStyle.GameEvents : DUIStyles.ButtonStyle.GameEventsCollapsed), WIDTH_420, 18)) { showGameEvents.target = !showGameEvents.target; } if (QUI.BeginFadeGroup(showGameEvents.faded)) { SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.BlueLight.Color); QUI.BeginVertical(WIDTH_420); { QUI.Space(SPACE_2); QUI.DrawList(gameEvents, WIDTH_420, "Not sending any Game Event on trigger... Click [+] to start..."); QUI.Space(SPACE_2); } QUI.EndVertical(); RestoreColors(); } QUI.EndFadeGroup(); }
void DrawEvents(float width) { if (!triggerOnGameEvent.boolValue && !triggerOnButtonClick.boolValue && !triggerOnButtonDoubleClick.boolValue && !triggerOnButtonLongClick.boolValue) { return; } if (triggerOnGameEvent.boolValue && (!dispatchAll.boolValue && string.IsNullOrEmpty(gameEvent.stringValue))) { return; } if ((triggerOnButtonClick.boolValue || triggerOnButtonDoubleClick.boolValue || triggerOnButtonLongClick.boolValue) && (!dispatchAll.boolValue && string.IsNullOrEmpty(buttonName.stringValue))) { return; } QUI.SetGUIBackgroundColor(AccentColorBlue); QUI.PropertyField(onTriggerEvent, new GUIContent("On Trigger Event"), width); QUI.ResetColors(); QUI.Space(SPACE_4); QUI.DrawCollapsableList("Game Events", showGameEventsAnimBool, gameEvents.arraySize > 0 ? QColors.Color.Blue : QColors.Color.Gray, gameEvents, width, 18, "Not sending any Game Events on trigger... Click [+] to start..."); }
void DrawOverlay() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Background Overlay", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 130); QUI.BeginChangeCheck(); { QUI.PropertyField(overlay, 281); } if (QUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); if (uiNotification.overlay != null) { uiNotification.overlay.transform.SetParent(uiNotification.transform); uiNotification.overlay.linkedToNotification = true; uiNotification.overlay.autoRegister = false; uiNotification.overlay.name = DUI.DUISettings.UIElement_Inspector_RenameGameObjectPrefix + "Background Overlay" + DUI.DUISettings.UIElement_Inspector_RenameGameObjectSuffix; } } } QUI.EndHorizontal(); }
void DrawTargetFSM() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Target FSM", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 68); GUI.enabled = overrideTargetFSM.boolValue; QUI.PropertyField(targetFSM, 276); GUI.enabled = true; if (targetFSM == null) { overrideTargetFSM.boolValue = true; } QUI.Toggle(overrideTargetFSM); QUI.Label("override", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 54); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(68); QUI.Label("FSM Name:", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 60); QUI.Label(playmakerEventDispatcher.targetFSM == null ? "---" : playmakerEventDispatcher.targetFSM.FsmName, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmallItalic)); } QUI.EndHorizontal(); }
void DrawTargetCanvas(float width) { QUI.BeginHorizontal(width); { tempFloat = width - 72; //background width QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, QColors.Color.Gray), tempFloat, 20); QUI.Space(-tempFloat); QUI.Space(SPACE_4); QLabel.text = "Canvas Name"; QLabel.style = Style.Text.Small; QUI.BeginVertical(QLabel.x, QUI.SingleLineHeight); { QUI.Space(1); QUI.Label(QLabel); } QUI.EndVertical(); if (EditorApplication.isPlayingOrWillChangePlaymode) { GUI.enabled = false; } tempFloat = width - QLabel.x - 92; //field width if (customTargetCanvasName.boolValue) { QUI.PropertyField(targetCanvasName, tempFloat); if (Event.current.isKey && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape) && Event.current.type == EventType.KeyUp) //if the Enter or Escape key have been pressed { customTargetCanvasName.boolValue = false; } } else { ValidateCanvasName(); QUI.BeginChangeCheck(); canvasNameIndex = EditorGUILayout.Popup(canvasNameIndex, DatabaseUICanvases.ToArray(), GUILayout.Width(tempFloat)); if (QUI.EndChangeCheck()) { Undo.RecordObject(target, "UpdateCanvasName"); targetCanvasName.stringValue = DUIData.Instance.DatabaseUICanvases[canvasNameIndex]; } } QUI.Space(SPACE_4); QLabel.text = "custom"; QLabel.style = Style.Text.Normal; QUI.BeginChangeCheck(); QUI.BeginVertical(QLabel.x + 28, 18); { QUI.Space(1); QUI.QToggle("custom", customTargetCanvasName); } QUI.EndVertical(); if (QUI.EndChangeCheck()) { if (!customTargetCanvasName.boolValue) { ValidateCanvasName(); } } GUI.enabled = true; } QUI.EndHorizontal(); infoMessage["EmptyTargetCanvasName"].show.target = string.IsNullOrEmpty(targetCanvasName.stringValue); DrawInfoMessage("EmptyTargetCanvasName", width); }
void DrawSound() { QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn After", Style.Text.Normal, 86); QUI.BeginChangeCheck(); QUI.PropertyField(despawnAfter, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); QUI.BeginChangeCheck(); QUI.Toggle(playOnSpawn); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.playOnSpawn = playOnSpawn.boolValue; } } } QUI.Label("Play On Spawn", Style.Text.Normal, 84); } QUI.EndHorizontal(); if (poolyDespawner.aSource == null) { QUI.Label("AudioSource: Not Found", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.aSource"].show.target = true; infoMessage["poolyDespawner.aSource.clip"].show.target = false; } else if (poolyDespawner.aSource.clip == null) { QUI.Label("AudioSource: " + poolyDespawner.aSource.gameObject.name, Style.Text.Normal, WIDTH_420); QUI.Label("AudioClip: Not Found", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.aSource"].show.target = false; infoMessage["poolyDespawner.aSource.clip"].show.target = true; } else { QUI.Label("AudioSource: " + poolyDespawner.aSource.gameObject.name, Style.Text.Normal, WIDTH_420); QUI.Label("AudioClip: " + poolyDespawner.aSource.clip.name, Style.Text.Normal, WIDTH_420); QUI.Label("Duration: " + poolyDespawner.aSource.clip.length + " seconds", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.aSource"].show.target = false; infoMessage["poolyDespawner.aSource.clip"].show.target = false; } QUI.ResetColors(); DrawInfoMessage("poolyDespawner.aSource", WIDTH_420); DrawInfoMessage("poolyDespawner.aSource.clip", WIDTH_420); }
void DrawTrigger2D() { QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn After", Style.Text.Normal, 86); QUI.BeginChangeCheck(); QUI.PropertyField(despawnAfter, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); if (!orDespawnAfterTime.boolValue) { QUI.BeginChangeCheck(); QUI.Toggle(orDespawnAfterTime); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.orDespawnAfterTime = orDespawnAfterTime.boolValue; } } } QUI.Label("Or Despawn After Time", Style.Text.Normal, 126); } else { QUI.BeginChangeCheck(); QUI.Toggle(orDespawnAfterTime); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.orDespawnAfterTime = orDespawnAfterTime.boolValue; } } } QUI.Label("Or Despawn After", Style.Text.Normal, 106); QUI.BeginChangeCheck(); QUI.PropertyField(duration, 40); if (duration.floatValue <= 0) { duration.floatValue = 0; } if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.duration = duration.floatValue; } } } QUI.Label("seconds", Style.Text.Normal, 50); } } QUI.EndHorizontal(); QUI.ResetColors(); infoMessage["duration.floatValue"].show.target = duration.floatValue <= 0 && orDespawnAfterTime.boolValue; DrawInfoMessage("duration.floatValue", WIDTH_420); QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn OnTrigger2D", Style.Text.Normal, 130); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerEnter2D); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerEnter2D = despawnOnTriggerEnter2D.boolValue; } } } QUI.Label("Enter2D", Style.Text.Normal, 50); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerStay2D); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerStay2D = despawnOnTriggerStay2D.boolValue; } } } QUI.Label("Stay2D", Style.Text.Normal, 42); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerExit2D); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerExit2D = despawnOnTriggerExit2D.boolValue; } } } QUI.Label("Exit2D", Style.Text.Normal, 40); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_4); QUI.BeginHorizontal(WIDTH_420); { QUI.PropertyField(onlyWithTag, 12); QUI.Label("Trigger Only By Tag", Style.Text.Normal, 114); QUI.BeginChangeCheck(); targetTag.stringValue = EditorGUILayout.TagField(targetTag.stringValue); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.targetTag = targetTag.stringValue; } } } QUI.Space(SPACE_4); } QUI.EndHorizontal(); QUI.ResetColors(); }
void DrawButtonName(float width) { QUI.BeginHorizontal(width); { if (EditorApplication.isPlayingOrWillChangePlaymode) { QLabel.text = buttonName.stringValue; QLabel.style = Style.Text.Help; QUI.Label(QLabel); } else { if (buttonCategory.stringValue.Equals(DUI.CUSTOM_NAME)) { QUI.PropertyField(buttonName, width - 5); } else { if (!DatabaseUIButtons.ContainsCategoryName(buttonCategory.stringValue)) //the category does not exist -> reset category and name { QUI.DisplayDialog("Info", "Button category has been reset to the default '" + DUI.UNCATEGORIZED_CATEGORY_NAME + "' value." + "\n\n" + "Button name has been reset to the default '" + DUI.DEFAULT_BUTTON_NAME + "' value.", "Ok"); //inform the dev that becuase he did not add the name to the database, it has been reset to its default value buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; //reset the category buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(buttonCategory.stringValue); //set the index buttonName.stringValue = DUI.DEFAULT_BUTTON_NAME; //reset the name buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } else if (!DatabaseUIButtons.Contains(buttonCategory.stringValue, buttonName.stringValue)) //category does not contain the set name -> ask de dev is it should be added { if (QUI.DisplayDialog("Action Required", "The name '" + buttonName.stringValue + "' was not found in the '" + buttonCategory.stringValue + "' category." + "\n\n" + "Do you want to add it to the database?", "Yes", "No")) //ask the dev if he wants to add this name to the database { DatabaseUIButtons.GetCategory(buttonCategory.stringValue).AddItemName(buttonName.stringValue, true); //add the item name to the database and save buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } else if (!DatabaseUIButtons.GetCategory(buttonCategory.stringValue).IsEmpty()) //select the first item in the category because it's not empty { buttonNameIndex = 0; //set the index buttonName.stringValue = DatabaseUIButtons.GetCategory(buttonCategory.stringValue).itemNames[buttonNameIndex]; //get the name } else //reset category and name { QUI.DisplayDialog("Info", "Button category has been reset to the default '" + DUI.UNCATEGORIZED_CATEGORY_NAME + "' value." + "\n\n" + "Button name has been reset to the default '" + DUI.DEFAULT_BUTTON_NAME + "' value.", "Ok"); //inform the dev that becuase he did not add the name to the database, it has been reset to its default value buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; //reset the category buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(buttonCategory.stringValue); //set the index buttonName.stringValue = DUI.DEFAULT_BUTTON_NAME; //reset the name buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } } else //category contains the set name -> get its index { buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } QUI.BeginChangeCheck(); buttonNameIndex = EditorGUILayout.Popup(buttonNameIndex, DatabaseUIButtons.GetCategory(buttonCategory.stringValue).itemNames.ToArray(), GUILayout.Width(width - 5)); if (QUI.EndChangeCheck()) { buttonName.stringValue = DatabaseUIButtons.GetCategory(buttonCategory.stringValue).itemNames[buttonNameIndex]; } } } QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_4); }
void DrawEffect() { QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn After", Style.Text.Normal, 86); QUI.BeginChangeCheck(); QUI.PropertyField(despawnAfter, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); QUI.BeginChangeCheck(); QUI.Toggle(playOnSpawn); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.playOnSpawn = playOnSpawn.boolValue; } } } QUI.Label("Play On Spawn", Style.Text.Normal, 84); } QUI.EndHorizontal(); if (poolyDespawner.pSystem == null) { QUI.Label("ParticleSystem: Not Found", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.pSystem"].show.target = true; } else { QUI.Label("ParticleSystem: " + poolyDespawner.pSystem.gameObject.name, Style.Text.Normal, WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.BeginChangeCheck(); QUI.PropertyField(useParticleSystemDuration, 12); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.useParticleSystemDuration = useParticleSystemDuration.boolValue; } } } QUI.Label("Duration: " + poolyDespawner.pSystem.main.duration + " seconds", Style.Text.Normal, WIDTH_420 - 12); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.BeginChangeCheck(); QUI.PropertyField(useParticleSystemStartDelay, 12); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.useParticleSystemStartDelay = useParticleSystemStartDelay.boolValue; } } } QUI.Label("Start Delay: " + poolyDespawner.pSystem.main.startDelay.constant + " seconds", Style.Text.Normal, WIDTH_420); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.BeginChangeCheck(); QUI.PropertyField(useParticleSystemStartLifetime, 12); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.useParticleSystemStartLifetime = useParticleSystemStartLifetime.boolValue; } } } QUI.Label("Start Lifetime: " + poolyDespawner.pSystem.main.startLifetime.constant + " seconds", Style.Text.Normal, WIDTH_420); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Extra Time", Style.Text.Normal, 65); QUI.BeginChangeCheck(); QUI.PropertyField(extraTime, 40); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.extraTime = extraTime.floatValue; } } } QUI.Label("seconds", Style.Text.Normal, 50); } QUI.EndHorizontal(); QUI.Space(SPACE_2); QUI.Button(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, QColors.Color.Purple), WIDTH_420, 20); QUI.Space(-20); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(2); QUI.Label("Total Duration until despawn: " + poolyDespawner.pSystemTotalDuration + " seconds", Style.Text.Normal, WIDTH_420); } QUI.EndHorizontal(); infoMessage["poolyDespawner.pSystem"].show.target = false; } QUI.ResetColors(); DrawInfoMessage("poolyDespawner.pSystem", WIDTH_420); }