// -------------------- 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")); }
// ---------------- static public void ShowWizard(TouchControlPanel panel, BindingSetup bindingSetup = null, System.Action onCreationCallback = null) { SuperTouchZoneCreationWizard w = (SuperTouchZoneCreationWizard)EditorWindow.GetWindow(typeof(SuperTouchZoneCreationWizard), true, "CF2 Touch Zone Wizard"); if (w != null) { w.Init(panel, bindingSetup, onCreationCallback); w.ShowPopup(); } }
// --------------- public override void OnInspectorGUI() { TouchControlPanel panel = (TouchControlPanel)this.target; GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerTouchPanel, GUILayout.ExpandWidth(true)); if (panel.rig == null) { InspectorUtils.DrawErrorBox("This panel is not connected to a Input Rig!"); } if (GUILayout.Button("Add Button")) { TouchButtonCreationWizard.ShowWizard(panel); } if (GUILayout.Button("Add Joystick")) { TouchJoystickCreationWizard.ShowWizard(panel); } if (GUILayout.Button("Add Steering Wheel")) { TouchWheelCreationWizard.ShowWizard(panel); } if (GUILayout.Button("Add Trackpad")) { TouchTrackPadCreationWizard.ShowWizard(panel); } if (GUILayout.Button("Add Touch Zone")) { SuperTouchZoneCreationWizard.ShowWizard(panel); } if (GUILayout.Button("Add Touch Splitter")) { TouchSplitterCreationWizard.ShowWizard(panel); } // Settings GUI... }
// ---------------------- public void Apply(SuperTouchZoneCreationWizard wizard) { if ((this.fingerNum < 1) || (this.fingerNum > SuperTouchZone.MAX_FINGERS)) { return; } FingerBinding fb = wizard.fingerBinding[this.fingerNum - 1]; SetupDigitalBinding(fb.gestureBinding.normalPressBinding, this.pressAxis, this.pressKey); SetupDigitalBinding(fb.gestureBinding.tapBinding, this.tapAxis, this.tapKey); SetupAxisBinding(fb.gestureBinding.normalPressSwipeHorzAxisBinding, this.horzDeltaAxis); SetupAxisBinding(fb.gestureBinding.normalPressSwipeVertAxisBinding, this.vertDeltaAxis); SetupAxisBinding(fb.gestureBinding.normalPressScrollHorzBinding.deltaBinding, this.horzScrollAxis); SetupAxisBinding(fb.gestureBinding.normalPressScrollVertBinding.deltaBinding, this.vertScrollAxis); if (this.bindToEmuTouch) { fb.gestureBinding.normalPressEmuTouchBinding.Enable(); } switch (this.mouseBindingTarget) { case MouseBindingTarget.RawPress: fb.gestureBinding.rawPressMousePosBinding.Enable(); break; case MouseBindingTarget.NormalPress: fb.gestureBinding.normalPressMousePosBinding.Enable(); break; case MouseBindingTarget.LongPress: fb.gestureBinding.longPressMousePosBinding.Enable(); break; case MouseBindingTarget.Tap: fb.gestureBinding.tapMousePosBinding.Enable(); break; case MouseBindingTarget.DoubleTap: fb.gestureBinding.doubleTapMousePosBinding.Enable(); break; case MouseBindingTarget.LongTap: fb.gestureBinding.longTapMousePosBinding.Enable(); break; case MouseBindingTarget.NormalPressSwipe: fb.gestureBinding.normalPressSwipeMousePosBinding.Enable(); break; case MouseBindingTarget.LongPressSwipe: fb.gestureBinding.longPressSwipeMousePosBinding.Enable(); break; } }