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 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..."); }