// -------------------- public FingerBinding(SuperTouchZoneCreationWizard wizard, string prefix) { this.wizard = wizard; this.prefix = prefix; this.gestureBinding = new TouchGestureStateBinding(null); this.gestureBindingInsp = new TouchGestureStateBindingInspector(null, new GUIContent("Gesture Bindings")); }
// ------------------ public void Draw(TouchGestureStateBinding bind, TouchGestureConfig config, InputRig rig) { bool bindingEnabled = bind.enabled; //EditorGUILayout.BeginVertical(); //if (bindingEnabled = EditorGUILayout.ToggleLeft(this.labelContent, bindingEnabled, GUILayout.MinWidth(30), GUILayout.ExpandWidth(true))) // { // CFGUI.BeginIndentedVertical(); if (InspectorUtils.BeginIndentedCheckboxSection(this.labelContent, ref bindingEnabled)) { InspectorUtils.BeginIndentedSection(new GUIContent("Press bindings")); this.rawPressBinding.Draw(bind.rawPressBinding, rig); this.rawPressMousePosBindingInsp.Draw(bind.rawPressMousePosBinding, rig); EditorGUILayout.Space(); this.normalPressBinding.Draw(bind.normalPressBinding, rig); this.normalPressMousePosBindingInsp.Draw(bind.normalPressMousePosBinding, rig); EditorGUILayout.Space(); if ((config == null) || config.detectLongPress) { this.longPressBinding.Draw(bind.longPressBinding, rig); this.longPressMousePosBindingInsp.Draw(bind.longPressMousePosBinding, rig); } EditorGUILayout.Space(); this.rawPressEmuTouchInsp.Draw(bind.rawPressEmuTouchBinding, rig); this.normalPressEmuTouchInsp.Draw(bind.normalPressEmuTouchBinding, rig); if ((config == null) || config.detectLongPress) { this.longPressEmuTouchInsp.Draw(bind.longPressEmuTouchBinding, rig); } InspectorUtils.EndIndentedSection(); if ((config == null) || (config.maxTapCount >= 1) || (config.detectLongTap)) { InspectorUtils.BeginIndentedSection(new GUIContent("Tap bindings")); if ((config == null) || (config.maxTapCount >= 1)) { this.tapBinding.Draw(bind.tapBinding, rig); this.tapMousePosBindingInsp.Draw(bind.tapMousePosBinding, rig); EditorGUILayout.Space(); } if ((config == null) || (config.maxTapCount >= 2)) { this.doubleTapBinding.Draw(bind.doubleTapBinding, rig); this.doubleTapMousePosBindingInsp.Draw(bind.doubleTapMousePosBinding, rig); EditorGUILayout.Space(); } if ((config == null) || (config.detectLongPress && config.detectLongTap)) { this.longTapBinding.Draw(bind.longTapBinding, rig); this.longTapMousePosBindingInsp.Draw(bind.longTapMousePosBinding, rig); EditorGUILayout.Space(); } InspectorUtils.EndIndentedSection(); } InspectorUtils.BeginIndentedSection(new GUIContent("Swipe bindings")); this.normalPressSwipeHorzAxisBinding.Draw(bind.normalPressSwipeHorzAxisBinding, rig); this.normalPressSwipeVertAxisBinding.Draw(bind.normalPressSwipeVertAxisBinding, rig); this.normalPressSwipeMousePosBindingInsp.Draw(bind.normalPressSwipeMousePosBinding, rig); this.normalPressSwipeDirBinding.Draw(bind.normalPressSwipeDirBinding, rig); this.normalPressSwipeJoyBinding.Draw(bind.normalPressSwipeJoyBinding, rig); if ((config == null) || config.detectLongPress) { this.longPressSwipeHorzAxisBinding.Draw(bind.longPressSwipeHorzAxisBinding, rig); this.longPressSwipeVertAxisBinding.Draw(bind.longPressSwipeVertAxisBinding, rig); this.longPressSwipeMousePosBindingInsp.Draw(bind.longPressSwipeMousePosBinding, rig); this.longPressSwipeDirBinding.Draw(bind.longPressSwipeDirBinding, rig); this.longPressSwipeJoyBinding.Draw(bind.longPressSwipeJoyBinding, rig); } InspectorUtils.EndIndentedSection(); InspectorUtils.BeginIndentedSection(new GUIContent("Scroll bindings")); this.normalPressScrollHorzBinding.Draw(bind.normalPressScrollHorzBinding, rig); this.normalPressScrollVertBinding.Draw(bind.normalPressScrollVertBinding, rig); if ((config == null) || config.detectLongPress) { this.longPressScrollHorzBinding.Draw(bind.longPressScrollHorzBinding, rig); this.longPressScrollVertBinding.Draw(bind.longPressScrollVertBinding, rig); } InspectorUtils.EndIndentedSection(); if (this.customPostGUICallback != null) { InspectorUtils.BeginIndentedSection(new GUIContent("Other")); this.customPostGUICallback(); InspectorUtils.EndIndentedSection(); } InspectorUtils.EndIndentedSection(); //CFGUI.EndIndentedVertical(); //GUILayout.Space(InputBindingGUIUtils.VERT_MARGIN); } //EditorGUILayout.EndVertical(); if ((bindingEnabled != bind.enabled)) { CFGUI.CreateUndo("Touch Binding modification.", this.undoObject); bind.enabled = bindingEnabled; CFGUI.EndUndo(this.undoObject); } }