// ------------------ public TouchGestureStateBindingInspector(/*Editor editor,*/ Object undoObject, GUIContent labelContent) { this.labelContent = labelContent; //this.editor = editor; this.undoObject = undoObject; this.rawPressBinding = new DigitalBindingInspector(undoObject, new GUIContent("Raw Press", "Bind Raw Press state to an axis and/or a key.")); this.rawPressMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Raw Press Mouse Pos", "Bind raw press position as virtual mouse position.")); this.normalPressBinding = new DigitalBindingInspector(undoObject, new GUIContent("Normal Press", "Bind Normal Press (after a potential tap has been rulled out) state to an axis and/or a key.")); this.normalPressMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Normal Press Mouse Pos", "Bind Normal press position as virtual mouse position.")); this.longPressBinding = new DigitalBindingInspector(undoObject, new GUIContent("Long Press", "Bind Long Press state to an axis and/or a key.")); this.longPressMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Long Press Mouse Pos", "Bind long press position as virtual mouse position.")); this.tapBinding = new DigitalBindingInspector(undoObject, new GUIContent("Tap", "Bind Single Tap to an axis and/or a key.")); this.tapMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Tap Mouse Pos", "Bind tap position as virtual mouse position.")); this.doubleTapBinding = new DigitalBindingInspector(undoObject, new GUIContent("Double Tap", "Bind Double Tap to an axis and/or a key.")); this.doubleTapMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Double Tap Mouse Pos", "Bind double tap position as virtual mouse position.")); this.longTapBinding = new DigitalBindingInspector(undoObject, new GUIContent("Long Tap", "Bind Long Tap state to an axis and/or a key.")); this.longTapMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Long Tap Mouse Pos", "Bind long tap position as virtual mouse position.")); this.normalPressSwipeHorzAxisBinding = new AxisBindingInspector(undoObject, new GUIContent("Horizontal Swipe Delta (Normal Press)", "Bind Horizontal swipe delta to an axis."), true, InputRig.InputSource.TouchDelta); this.normalPressSwipeVertAxisBinding = new AxisBindingInspector(undoObject, new GUIContent("Vertical Swipe Delta (Normal Press)", "Bind Vertical swipe delta to an axis."), true, InputRig.InputSource.TouchDelta); this.normalPressSwipeDirBinding = new DirectionBindingInspector(undoObject, new GUIContent("Swipe Segment's Direction (Normal Press)", "Swipe segment's direction.")); this.normalPressSwipeMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Swipe Mouse Pos (Normal Press)", "Bind swipe position as virtual mouse position.")); this.normalPressSwipeJoyBinding = new JoystickStateBindingInspector(undoObject, new GUIContent("Swipe Joystick (Normal Press)", "Swipe Joystick-like state binding.")); this.longPressSwipeJoyBinding = new JoystickStateBindingInspector(undoObject, new GUIContent("Swipe Joystick (Long Press)", "Swipe Joystick-like state binding.")); this.normalPressScrollHorzBinding = new ScrollDeltaBindingInspector(undoObject, new GUIContent("Horizontal Scoll Delta (Normal Press)", "Bind Horizontal scroll delta.")); //true, , InputRig.InputSource.SCROLL); this.normalPressScrollVertBinding = new ScrollDeltaBindingInspector(undoObject, new GUIContent("Vertical Scroll Delta (Normal Press)", "Bind Vertical scroll delta.")); // true, InputRig.InputSource.SCROLL); this.longPressSwipeHorzAxisBinding = new AxisBindingInspector(undoObject, new GUIContent("Horizontal Swipe Delta (Long Press)", "Bind Horizontal swipe delta to an axis."), true, InputRig.InputSource.TouchDelta); this.longPressSwipeVertAxisBinding = new AxisBindingInspector(undoObject, new GUIContent("Vertical Swipe Delta (Long Press)", "Bind Vertical swipe delta to an axis."), true, InputRig.InputSource.TouchDelta); this.longPressSwipeDirBinding = new DirectionBindingInspector(undoObject, new GUIContent("Swipe Segment's Direction (Long Press)", "Swipe segment's direction.")); this.longPressSwipeMousePosBindingInsp = new MousePositionBindingInspector(undoObject, new GUIContent("Swipe Mouse Pos (Long Press)", "Bind swipe position as virtual mouse position.")); this.longPressScrollHorzBinding = new ScrollDeltaBindingInspector(undoObject, new GUIContent("Horizontal Scoll Delta (Long Press)", "Bind Horizontal scroll delta.")); //true, , InputRig.InputSource.SCROLL); this.longPressScrollVertBinding = new ScrollDeltaBindingInspector(undoObject, new GUIContent("Vertical Scroll Delta (Long Press)", "Bind Vertical scroll delta.")); // true, InputRig.InputSource.SCROLL); //this.swipeDirBinding.SetCustomPreGUI(this.DrawSwipeBindModeGUI); this.rawPressEmuTouchInsp = new EmuTouchBindingInspector(undoObject, new GUIContent("Raw Press as Emulated Touch", "Bind touch's position and raw press state as emulated touch (Input.touches[]).")); this.normalPressEmuTouchInsp = new EmuTouchBindingInspector(undoObject, new GUIContent("Normal Press as Emulated Touch", "Bind touch's position and normal press state as emulated touch (Input.touches[]).")); this.longPressEmuTouchInsp = new EmuTouchBindingInspector(undoObject, new GUIContent("Long Press as Emulated Touch", "Bind touch's position and long press state as emulated touch (Input.touches[]).")); }
// --------------------- void OnEnable() { this.pinchDigitalBindingInsp = new DigitalBindingInspector(this.target, new GUIContent("Digital Pinch Binding", "Digital pinch state is active when user touches with two fingers and pinch them together past specified threshold.")); this.spreadDigitalBindingInsp = new DigitalBindingInspector(this.target, new GUIContent("Digital Spread Binding", "Digital spread state is active when user touches with two fingers and spread them apart past specified threshold.")); this.twistRightDigitalBindingInsp = new DigitalBindingInspector(this.target, new GUIContent("Twist Right Digital Binding", "Digital twist to the right state is active when user touches with two fingers and twists them clockwise past specified threshold.")); this.twistLeftDigitalBindingInsp = new DigitalBindingInspector(this.target, new GUIContent("Twist Left Digital Binding", "Digital twist to the left state is active when user touches with two fingers and twists them counter-clockwise past specified threshold.")); this.twistAnalogBindingInsp = new AxisBindingInspector(this.target, new GUIContent("Twist Analog Binding", "Bind twist analog state to an axis"), true, InputRig.InputSource.Analog, this.DrawTwistAnalogBindingExtraGUI); this.twistDeltaBindingInsp = new AxisBindingInspector(this.target, new GUIContent("Twist Delta Binding", "Bind twist delta to an axis"), true, InputRig.InputSource.NormalizedDelta, this.DrawTwistDeltaBindingExtraGUI); this.pinchAnalogBindingInsp = new AxisBindingInspector(this.target, new GUIContent("Pinch Analog Binding", "Bind pinch analog state to an axis"), true, InputRig.InputSource.Analog, this.DrawPinchAnalogBindingExtraGUI); this.pinchDeltaBindingInsp = new AxisBindingInspector(this.target, new GUIContent("Pinch Delta Binding", "Bind pinch delta to an axis"), true, InputRig.InputSource.NormalizedDelta, this.DrawPinchDeltaBindingExtraGUI); this.pinchScrollDeltaBindingInsp = new ScrollDeltaBindingInspector(this.target, new GUIContent("Pinch Scroll Delta Binding")); this.twistScrollDeltaBindingInsp = new ScrollDeltaBindingInspector(this.target, new GUIContent("Twist Scroll Delta Binding")); this.pinchAnalogConfigInsp = new AnalogConfigInspector(this.target, new GUIContent("Analog Pinch Config"), false); this.twistAnalogConfigInsp = new AnalogConfigInspector(this.target, new GUIContent("Analog Twist Config"), false); this.pinchAnalogConfigInsp.SetDigitalSectionVisibility(false); this.twistAnalogConfigInsp.SetDigitalSectionVisibility(false); this.touchThreshInsp = new TouchGestureThresholdsInspector(this.target, new GUIContent("Gesture Thresholds")); this.separateFingersAsEmuTouchesBindingInsp = new EmuTouchBindingInspector(this.target, new GUIContent("Bind Separate Fingers as Emu. Touches", "Bind separate fingers touching this touch zone to rig's emulated touches (Input.touches[]).")); this.multiFingerConfigInspArray = new MultiFingerTouchConfigInspector[ControlFreak2.SuperTouchZone.MAX_FINGERS]; for (int i = 0; i < this.multiFingerConfigInspArray.Length; ++i) { string labelPrefix = ( (i == 0) ? "Single finger" : (i == 1) ? "Double finger" : (i == 2) ? "Triple finger" : ((i + 1).ToString() + "-finger")); this.multiFingerConfigInspArray[i] = new MultiFingerTouchConfigInspector((ControlFreak2.SuperTouchZone) this.target, new GUIContent(labelPrefix + " Touch Configuration", "Configure multi-finger touch"), new GUIContent(labelPrefix + " Touch Binding")); } base.InitTouchControlInspector(); }