void DrawSettings(float width) { QUI.QToggle("Auto disable Button Clicks when an UIElement is in trasition", autoDisableButtonClicks); QUI.Space(SPACE_4); //CONTROLLER INPUT MODE QUI.BeginHorizontal(width); { if ((ControllerInputMode)backButtonInputMode.enumValueIndex == ControllerInputMode.None) { QUI.SetGUIBackgroundColor(QUI.AccentColorRed); } QUI.QObjectPropertyField("'Back' button Input Mode", backButtonInputMode, 260, 20, false); QUI.ResetColors(); QUI.Space(SPACE_2); if ((ControllerInputMode)backButtonInputMode.enumValueIndex != ControllerInputMode.None) { QUI.QToggle("enable alternate inputs", enableBackButtonAlternateInputs); } QUI.FlexibleSpace(); } QUI.EndHorizontal(); if ((ControllerInputMode)backButtonInputMode.enumValueIndex != ControllerInputMode.None) { QUI.BeginHorizontal(width); { if ((ControllerInputMode)backButtonInputMode.enumValueIndex == ControllerInputMode.KeyCode) { QUI.QObjectPropertyField("Key Code", backButtonKeyCode, width / 2 - 1, 20, false); QUI.Space(SPACE_2); GUI.enabled = enableBackButtonAlternateInputs.boolValue; if (!enableBackButtonAlternateInputs.boolValue) { QUI.SetGUIBackgroundColor(QUI.AccentColorRed); } QUI.QObjectPropertyField("Alternate", backButtonKeyCodeAlt, width / 2 - 1, 20, false); QUI.ResetColors(); GUI.enabled = true; } else if ((ControllerInputMode)backButtonInputMode.enumValueIndex == ControllerInputMode.VirtualButton) { QUI.QObjectPropertyField("Virtual Button", backButtonVirtualButtonName, width / 2 - 1, 20, false); QUI.Space(SPACE_2); GUI.enabled = enableBackButtonAlternateInputs.boolValue; if (!enableBackButtonAlternateInputs.boolValue) { QUI.SetGUIBackgroundColor(QUI.AccentColorRed); } QUI.QObjectPropertyField("Alternate", backButtonVirtualButtonNameAlt, width / 2 - 1, 20, false); QUI.ResetColors(); GUI.enabled = true; } QUI.FlexibleSpace(); } QUI.EndHorizontal(); } }
void DrawDrawerSpeed(float width) { QUI.BeginHorizontal(width); { QUI.QObjectPropertyField("Open Speed", openSpeed, width / 2 - 1, 20, false); QUI.Space(SPACE_2); QUI.QObjectPropertyField("Close Speed", closeSpeed, width / 2 - 1, 20, false); } QUI.EndHorizontal(); }
public override void OnInspectorGUI() { DrawHeader(DUIResources.headerGestureDetector.texture, WIDTH_420, HEIGHT_42); serializedObject.Update(); QUI.QToggle("debug", debug); QUI.Space(SPACE_2); QUI.QToggle("is Global Gesture Detector", isGlobalGestureDetector); QUI.Space(SPACE_2); showTarget.target = !isGlobalGestureDetector.boolValue; if (QUI.BeginFadeGroup(showTarget.faded)) { QUI.BeginHorizontal(GlobalWidth); { GUI.enabled = overrideTarget.boolValue; QUI.QObjectPropertyField("Target GameObject", targetGameObject, GlobalWidth - 100); GUI.enabled = true; QUI.Space(SPACE_2); QUI.QToggle("override", overrideTarget, 20); } QUI.EndHorizontal(); } QUI.EndFadeGroup(); QUI.Space(SPACE_2); showSwipeDirection.target = (GestureType)gestureType.enumValueIndex == GestureType.Swipe; QUI.BeginHorizontal(GlobalWidth); { QUI.QObjectPropertyField("Gesture Type", gestureType, ((GlobalWidth - SPACE_2) / 2), 20, false); QUI.Space(SPACE_2); if (showSwipeDirection.faded > 0.2f) { QUI.QObjectPropertyField("Swipe Direction", swipeDirection, ((GlobalWidth - SPACE_2) / 2) * showSwipeDirection.faded, 20, false); } QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_2); switch ((GestureType)gestureType.enumValueIndex) { case GestureType.Tap: DUIUtils.DrawUnityEvents(gestureDetector.OnTap.GetPersistentEventCount() > 0, showOnTap, OnTap, "OnTap", GlobalWidth, MiniBarHeight); break; case GestureType.LongTap: DUIUtils.DrawUnityEvents(gestureDetector.OnLongTap.GetPersistentEventCount() > 0, showOnLongTap, OnLongTap, "OnLongTap", GlobalWidth, MiniBarHeight); break; case GestureType.Swipe: DUIUtils.DrawUnityEvents(gestureDetector.OnSwipe.GetPersistentEventCount() > 0, showOnSwipe, OnSwipe, "OnSwipe", GlobalWidth, MiniBarHeight); break; } QUI.Space(SPACE_2); QUI.DrawCollapsableList("Game Events", showGameEventsAnimBool, gameEvents.arraySize > 0 ? QColors.Color.Blue : QColors.Color.Gray, gameEvents, GlobalWidth, 18, "Not sending any Game Events on gesture... Click [+] to start..."); QUI.Space(SPACE_2); DUIUtils.DrawNavigation(target, gestureDetector.navigationPointerData, editorNavigationData, showNavigation, UpdateAllNavigationData, true, false, GlobalWidth, MiniBarHeight); serializedObject.ApplyModifiedProperties(); QUI.Space(SPACE_4); }
void DrawIcon(float width) { QUI.BeginChangeCheck(); QUI.QObjectPropertyField("Notification Icon", icon, width); if (QUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); if (uiNotification.icon != null) { uiNotification.icon.name = "Notification Icon"; } } }
void DrawMessage(float width) { QUI.BeginChangeCheck(); QUI.QObjectPropertyField("Notification Message", message, width); if (QUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); if (uiNotification.message != null) { uiNotification.message.name = "Notification Message"; } } }
public override void OnInspectorGUI() { DrawHeader(DUIResources.headerTouchManager.texture, WIDTH_420, HEIGHT_42); serializedObject.Update(); QUI.QToggle("debug", debug); QUI.Space(SPACE_2); QUI.QObjectPropertyField("Min Swipe Length", minSwipeLength, GlobalWidth, 20, false); QUI.Space(SPACE_2); QUI.QObjectPropertyField("Long Tap Duration", longTapDuration, 174, 20, false); QUI.Space(SPACE_2); QUI.QToggle("use eight directions", useEightDirections); serializedObject.ApplyModifiedProperties(); QUI.Space(SPACE_4); }
void DrawOverlay(float width) { QUI.BeginChangeCheck(); QUI.QObjectPropertyField("Background Overlay", overlay, width); 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; } } }
void DrawOverlay(float width) { QUI.QObjectPropertyField("Overlay", overlay, width, 20, true); QUI.BeginHorizontal(width); { QLabel.text = "When Closed"; QLabel.style = Style.Text.Small; QUI.LabelWithBackground(QLabel); QUI.Space(SPACE_4); QUI.QToggle("Disable", disableOverlayWhenClosed); QUI.Space(SPACE_4); QUI.QToggle("Dont Disable Canvas", dontDisableOverlayCanvasWhenClosed); QUI.FlexibleSpace(); } QUI.EndHorizontal(); }
void DrawNotificationContainer(float width) { QUI.BeginChangeCheck(); QUI.QObjectPropertyField("Notification Container", notificationContainer, width); if (QUI.EndChangeCheck()) { serializedObject.ApplyModifiedProperties(); if (uiNotification.notificationContainer != null) { uiNotification.notificationContainer.transform.SetParent(uiNotification.transform); uiNotification.notificationContainer.linkedToNotification = true; uiNotification.notificationContainer.autoRegister = false; uiNotification.notificationContainer.name = DUI.DUISettings.UIElement_Inspector_RenameGameObjectPrefix + "Notification Container" + DUI.DUISettings.UIElement_Inspector_RenameGameObjectSuffix; } } infoMessage["MissingNotificationContainer"].show.target = notificationContainer.objectReferenceValue == null; DrawInfoMessage("MissingNotificationContainer", width); }
void DrawContainer(float width) { QUI.QObjectPropertyField("Container", container, width, 20, true); QUI.BeginHorizontal(width); { QLabel.text = "When Closed"; QLabel.style = Style.Text.Small; QUI.LabelWithBackground(QLabel); QUI.Space(SPACE_4); QUI.QToggle("Fade Out", fadeOutContainerWhenClosed); QUI.Space(SPACE_4); QUI.QToggle("Disable", disableContainerWhenClosed); QUI.Space(SPACE_4); QUI.QToggle("Dont Disable Canvas", dontDisableContainerCanvasWhenClosed); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.BeginHorizontal(width); { QUI.QObjectPropertyField("Container Size", containerSize, width - 160 - 2, 20, false); QUI.Space(SPACE_2); if (QUI.GhostButton("Update Container", QColors.Color.Gray, 160, 20, false)) { UpdateContainer(); } } QUI.EndHorizontal(); QUI.BeginHorizontal(width); { if ((UIDrawer.ContainerSize)containerSize.enumValueIndex == UIDrawer.ContainerSize.PercentageOfScreen) { QUI.QObjectPropertyField("Percentage (0 - 1)", containerPercentageOfScreenSize, (width - 4) * 0.2f, 20, false); QUI.Space(SPACE_2); QUI.QObjectPropertyField("Min Size", containerMinimumSize, (width - 2) * 0.6f, 20, false); } else if ((UIDrawer.ContainerSize)containerSize.enumValueIndex == UIDrawer.ContainerSize.FixedSize) { QUI.QObjectPropertyField("Fixed Size", containerFixedSize, width, 20, false); } } QUI.EndHorizontal(); }
void DrawDrawerNameAndDirection(float width) { GUI.enabled = !EditorApplication.isPlayingOrWillChangePlaymode; QUI.BeginHorizontal(width); { QUI.QObjectPropertyField("Drawer Name", drawerName, 260, 20, false); QUI.Space(SPACE_4); QUI.QObjectPropertyField("Close Direction", drawerCloseDirection, width - 260 - 4, 20, false); if ((Gestures.SimpleSwipe)drawerCloseDirection.enumValueIndex == Gestures.SimpleSwipe.None) { drawerCloseDirection.enumValueIndex = (int)Gestures.SimpleSwipe.Left; } QUI.FlexibleSpace(); } QUI.EndHorizontal(); GUI.enabled = true; infoMessage["AutoGeneratedDrawerName"].title = "'" + Drawer.GetDrawerName() + "' - will be the auto-generated Drawer Name."; infoMessage["AutoGeneratedDrawerName"].show.target = drawerName.stringValue.Equals(UIDrawer.DEFAULT_DRAWER_NAME); DrawInfoMessage("AutoGeneratedDrawerName", width); QUI.Space(SPACE_2 * infoMessage["AutoGeneratedDrawerName"].show.faded); }
void DrawTargetFSM() { QUI.BeginHorizontal(WIDTH_420); { GUI.enabled = overrideTargetFSM.boolValue; QUI.QObjectPropertyField("Target FSM", targetFSM, WIDTH_420 - 78); GUI.enabled = true; if (targetFSM == null) { overrideTargetFSM.boolValue = true; } QUI.QToggle("override", overrideTargetFSM); } QUI.EndHorizontal(); QUI.Space(-SPACE_2); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(78); QLabel.text = "FSM Name: " + (playmakerEventDispatcher.targetFSM == null ? "---" : playmakerEventDispatcher.targetFSM.FsmName); QLabel.style = Style.Text.Help; QUI.Label(QLabel); } QUI.EndHorizontal(); }
void DrawArrowHolder(string direction, SerializedProperty holder, SerializedProperty closed, SerializedProperty opened, float width) { QUI.BeginHorizontal(width - SPACE_8); { QUI.Space(SPACE_8 * showArrowReferences.faded); QUI.QObjectPropertyField(direction + " Drawer Arrow Holder", holder, width - 16, 20, true); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.BeginHorizontal(width - SPACE_8); { QUI.Space(SPACE_16 * showArrowReferences.faded); QUI.QObjectPropertyField("Closed Position", closed, width - 24, 20, true); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.BeginHorizontal(width - SPACE_8); { QUI.Space(SPACE_16 * showArrowReferences.faded); QUI.QObjectPropertyField("Opened Position", opened, width - 24, 20, true); QUI.FlexibleSpace(); } QUI.EndHorizontal(); }
void DrawCloseButton(float width) { QUI.QObjectPropertyField("Close Button", closeButton, width); }
void DrawArrow(float width) { QUI.BeginHorizontal(width); { QUI.QToggle("Show Arrow", showArrow); QUI.FlexibleSpace(); } QUI.EndHorizontal(); showArrowAnimBool.target = showArrow.boolValue; if (QUI.BeginFadeGroup(showArrowAnimBool.faded)) { QUI.BeginVertical(width); { QUI.Space(SPACE_2 * showArrowAnimBool.faded); QUI.BeginHorizontal(width); { QUI.QObjectPropertyField("Arrow", arrow, width - 4 - 100, 20, true); QUI.Space(SPACE_4 * showArrowAnimBool.faded); QUI.QObjectPropertyField("Scale", arrowScale, 100, 20, false); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.BeginHorizontal(width); { QUI.QToggle("Override Arrow Color", overrideArrowColor); QUI.Space(SPACE_2); if (overrideArrowColor.boolValue) { tempFloat = (width - 152) / 2; //color fields width QUI.QObjectPropertyField("Closed", arrowColorWhenClosed, tempFloat, 20, false); QUI.Space(SPACE_2); QUI.QObjectPropertyField("Opened", arrowColorWhenOpened, tempFloat, 20, false); } QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_2); QUI.BeginHorizontal(width); { if (QUI.GhostButton("Reset Arrow Holder Pos", QColors.Color.Gray, (width - 4) / 3, 18)) { Undo.RecordObject(Drawer.leftDrawerArrowHolder, "Update Arrow Holder"); switch (Drawer.drawerCloseDirection) { case Gestures.SimpleSwipe.Left: UIDrawer.ResetArrowHolder(Drawer.leftDrawerArrowHolder, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Right: UIDrawer.ResetArrowHolder(Drawer.rightDrawerArrowHolder, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Up: UIDrawer.ResetArrowHolder(Drawer.upDrawerArrowHolder, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Down: UIDrawer.ResetArrowHolder(Drawer.downDrawerArrowHolder, Drawer.drawerCloseDirection); break; } } QUI.Space(SPACE_2); if (QUI.GhostButton("Reset Closed Arrow Pos", QColors.Color.Gray, (width - 4) / 3, 18)) { Undo.RecordObject(Drawer.leftDrawerArrowClosedPosition, "Update Closed Arrow"); switch (Drawer.drawerCloseDirection) { case Gestures.SimpleSwipe.Left: UIDrawer.ResetClosedArrow(Drawer.leftDrawerArrowClosedPosition, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Right: UIDrawer.ResetClosedArrow(Drawer.rightDrawerArrowClosedPosition, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Up: UIDrawer.ResetClosedArrow(Drawer.upDrawerArrowClosedPosition, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Down: UIDrawer.ResetClosedArrow(Drawer.downDrawerArrowClosedPosition, Drawer.drawerCloseDirection); break; } } QUI.Space(SPACE_2); if (QUI.GhostButton("Reset Opened Arrow Pos", QColors.Color.Gray, (width - 4) / 3, 18)) { Undo.RecordObject(Drawer.leftDrawerArrowOpenedPosition, "Update Opened Arrow"); switch (Drawer.drawerCloseDirection) { case Gestures.SimpleSwipe.Left: UIDrawer.ResetOpenedArrow(Drawer.leftDrawerArrowOpenedPosition, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Right: UIDrawer.ResetOpenedArrow(Drawer.rightDrawerArrowOpenedPosition, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Up: UIDrawer.ResetOpenedArrow(Drawer.upDrawerArrowOpenedPosition, Drawer.drawerCloseDirection); break; case Gestures.SimpleSwipe.Down: UIDrawer.ResetOpenedArrow(Drawer.downDrawerArrowOpenedPosition, Drawer.drawerCloseDirection); break; } } } QUI.EndHorizontal(); QUI.Space(SPACE_2); QUI.BeginHorizontal(width); { if (QUI.GhostButton("Copy - Opened Arrow Position - to - Closed Arrow Position", QColors.Color.Gray, width, 18)) { Undo.RecordObject(Drawer.leftDrawerArrowOpenedPosition, "Update Opened Arrow"); switch (Drawer.drawerCloseDirection) { case Gestures.SimpleSwipe.Left: UIDrawer.MatchRectTransform(Drawer.leftDrawerArrowClosedPosition, Drawer.leftDrawerArrowOpenedPosition); break; case Gestures.SimpleSwipe.Right: UIDrawer.MatchRectTransform(Drawer.rightDrawerArrowClosedPosition, Drawer.rightDrawerArrowOpenedPosition); break; case Gestures.SimpleSwipe.Up: UIDrawer.MatchRectTransform(Drawer.upDrawerArrowClosedPosition, Drawer.upDrawerArrowOpenedPosition); break; case Gestures.SimpleSwipe.Down: UIDrawer.MatchRectTransform(Drawer.downDrawerArrowClosedPosition, Drawer.downDrawerArrowOpenedPosition); break; } } } QUI.EndHorizontal(); QUI.Space(SPACE_2); QUI.BeginHorizontal(width); { if (QUI.GhostButton("Copy - Closed Arrow Position - to - Opened Arrow Position", QColors.Color.Gray, width, 18)) { Undo.RecordObject(Drawer.leftDrawerArrowClosedPosition, "Update Closed Arrow"); switch (Drawer.drawerCloseDirection) { case Gestures.SimpleSwipe.Left: UIDrawer.MatchRectTransform(Drawer.leftDrawerArrowOpenedPosition, Drawer.leftDrawerArrowClosedPosition); break; case Gestures.SimpleSwipe.Right: UIDrawer.MatchRectTransform(Drawer.rightDrawerArrowOpenedPosition, Drawer.rightDrawerArrowClosedPosition); break; case Gestures.SimpleSwipe.Up: UIDrawer.MatchRectTransform(Drawer.upDrawerArrowOpenedPosition, Drawer.upDrawerArrowClosedPosition); break; case Gestures.SimpleSwipe.Down: UIDrawer.MatchRectTransform(Drawer.downDrawerArrowOpenedPosition, Drawer.downDrawerArrowClosedPosition); break; } } } QUI.EndHorizontal(); QUI.Space(SPACE_2); if (QUI.GhostBar("Show Arrow References", showArrowReferences.target ? QColors.Color.Blue : QColors.Color.Gray, showArrowReferences, width * showArrowAnimBool.faded, MiniBarHeight)) { showArrowReferences.target = !showArrowReferences.target; } QUI.BeginHorizontal(width); { QUI.Space(SPACE_8 * showArrowReferences.faded); if (QUI.BeginFadeGroup(showArrowReferences.faded)) { QUI.BeginVertical(width - SPACE_8); { QUI.Space(SPACE_4 * showArrowReferences.faded); QUI.QObjectPropertyField("Arrow Container", arrowContainer, width - SPACE_8, 20, true); QUI.Space(SPACE_2 * showArrowReferences.faded); DrawArrowHolder("Left", leftDrawerArrowHolder, leftDrawerArrowClosedPosition, leftDrawerArrowOpenedPosition, width); QUI.Space(SPACE_2 * showArrowReferences.faded); DrawArrowHolder("Right", rightDrawerArrowHolder, rightDrawerArrowClosedPosition, rightDrawerArrowOpenedPosition, width); QUI.Space(SPACE_2 * showArrowReferences.faded); DrawArrowHolder("Up", upDrawerArrowHolder, upDrawerArrowClosedPosition, upDrawerArrowOpenedPosition, width); QUI.Space(SPACE_2 * showArrowReferences.faded); DrawArrowHolder("Down", downDrawerArrowHolder, downDrawerArrowClosedPosition, downDrawerArrowOpenedPosition, width); QUI.Space(SPACE_2 * showArrowReferences.faded); } QUI.EndVertical(); } QUI.EndFadeGroup(); } QUI.EndHorizontal(); QUI.Space(SPACE_2 * showArrowAnimBool.faded); } QUI.EndVertical(); } QUI.EndFadeGroup(); }