Ejemplo n.º 1
0
        // ---------------
        public void DrawGUI(TouchGestureThresholds target)
        {
            if (this.foldable)
            {
                if (!CFGUI.BoldFoldout(this.titleContent, ref this.foldedOut))
                {
                    return;
                }


                InspectorUtils.BeginIndentedSection();         //CFGUI.BeginIndentedVertical(CFEditorStyles.Inst.transpSunkenBG);
            }
            else
            {
                InspectorUtils.BeginIndentedSection(this.titleContent);
            }


            this.DrawBasicGUI(target);

            MultiTouchGestureThresholds multiTarget = (target as MultiTouchGestureThresholds);

            if (multiTarget != null)
            {
                EditorGUILayout.Space();
                this.DrawMultiTouchGUI(multiTarget);
            }

            //CFGUI.EndIndentedVertical();
            InspectorUtils.EndIndentedSection();
        }
        // ------------------
        public void Draw(MousePositionBinding bind, InputRig rig)
        {
            bool bindingEnabled = bind.enabled;
            int  priority       = bind.priority;

            EditorGUILayout.BeginVertical();
            if (bindingEnabled = EditorGUILayout.ToggleLeft(this.labelContent, bindingEnabled, GUILayout.MinWidth(30)))
            {
                InspectorUtils.BeginIndentedSection();

                priority = EditorGUILayout.IntSlider(new GUIContent("Pos. prio.", "Position priority used to pick mouse position if there is more than one mouse position source in the rig at given frame."),
                                                     priority, 0, 100, GUILayout.MinWidth(30));

                InspectorUtils.EndIndentedSection();
            }
            EditorGUILayout.EndVertical();


            if ((bindingEnabled != bind.enabled) ||
                (priority != bind.priority))
            {
                CFGUI.CreateUndo("Mouse Position Binding modification.", this.undoObject);

                bind.enabled  = bindingEnabled;
                bind.priority = priority;

                CFGUI.EndUndo(this.undoObject);
            }
        }
Ejemplo n.º 3
0
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchJoystick c = (TouchJoystick)this.target;

            this.DrawWarnings(c);

            // Joystick GUI...


            GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerJoystick, GUILayout.ExpandWidth(true));

            // Steering Wheel specific inspector....

            InspectorUtils.BeginIndentedSection(new GUIContent("Joystick Settings"));

            this.joyConfigInsp.DrawGUI(c.config);

            InspectorUtils.EndIndentedSection();


            InspectorUtils.BeginIndentedSection(new GUIContent("Joystick Bindings"));


            this.pressBindingInsp.Draw(c.pressBinding, c.rig);

            this.joyStateBindingInsp.Draw(c.joyStateBinding, c.rig);

            InspectorUtils.EndIndentedSection();



            // Draw Shared Dynamic Control Params...

            this.DrawDynamicTouchControlGUI(c);
        }
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchSteeringWheelSpriteAnimator target = this.target as TouchSteeringWheelSpriteAnimator;

            if ((target == null))
            {
                return;
            }

            if (!TouchControlSpriteAnimatorInspector.DrawSourceGUI(target))
            {
                return;
            }



            InspectorUtils.BeginIndentedSection(new GUIContent("Sprite Settings"));

            this.spriteNeutral.Draw(target.spriteNeutral, target, true, false);

            EditorGUILayout.Space();
            this.spritePressed.Draw(target.spritePressed, target, target.IsIllegallyAttachedToSource());


            InspectorUtils.EndIndentedSection();


            // Scaling GUI...

            float
                rotationRange         = target.rotationRange,
                rotationSmoothingTime = target.rotationSmoothingTime;


            InspectorUtils.BeginIndentedSection(new GUIContent("Transform Animation Settings"));

            rotationRange = CFGUI.Slider(new GUIContent("Rot. range", "Wheel's Rotation Range"), rotationRange, 0, 180, 65);

            rotationSmoothingTime = CFGUI.FloatFieldEx(new GUIContent("Smooting Time (ms)", "Wheel Rotation Smooting Time in milliseconds"),
                                                       rotationSmoothingTime, 0, 10, 1000, true, 120);

            EditorGUILayout.Space();

//			TouchControlSpriteAnimatorInspector.DrawScaleGUI(target);

            InspectorUtils.EndIndentedSection();



            if ((rotationRange != target.rotationRange) ||
                (rotationSmoothingTime != target.rotationSmoothingTime))
            {
                CFGUI.CreateUndo("Sprite Animator Trsnaform modification", target);

                target.rotationRange         = rotationRange;
                target.rotationSmoothingTime = rotationSmoothingTime;

                CFGUI.EndUndo(target);
            }
        }
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchTrackPadSpriteAnimator target = this.target as TouchTrackPadSpriteAnimator;

            if ((target == null))
            {
                return;
            }

            if (!TouchControlSpriteAnimatorInspector.DrawSourceGUI(target))
            {
                return;
            }

//		TouchControlSpriteAnimatorInspector.DrawTimingGUI(target);



            InspectorUtils.BeginIndentedSection(new GUIContent("Sprite Settings"));

            this.spriteNeutral.Draw(target.spriteNeutral, target, true, false);

            EditorGUILayout.Space();
            this.spritePressed.Draw(target.spritePressed, target, target.IsIllegallyAttachedToSource());


            InspectorUtils.EndIndentedSection();

//
//		TouchControlSpriteAnimatorInspector.DrawDefaultTransformGUI(target);
        }
Ejemplo n.º 6
0
        // ---------------------
        override protected void DrawPresentationGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Presentation"));

            this.animatorStyle = (AnimatorStyle)CFGUI.EnumPopup(new GUIContent("Style", "Animator Style"), this.animatorStyle,
                                                                ControlCreationWizardBase.MAX_LABEL_WIDTH);

            if (this.animatorStyle == AnimatorStyle.BaseAndHat)
            {
                this.hatScale = CFGUI.Slider(new GUIContent("Hat Scale", "Hat's Scale relative to joystick's size"), this.hatScale, 0.1f, 1.0f,
                                             ControlCreationWizardBase.MAX_LABEL_WIDTH);
            }

            EditorGUILayout.Space();


            EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));

            EditorGUILayout.Space();
            if (this.animatorStyle == AnimatorStyle.BaseAndHat)
            {
                this.baseSprite = DrawSpriteBox(new GUIContent("Base", "Base Sprite for new joystick."), this.baseSprite);
                this.hatSprite  = DrawSpriteBox(new GUIContent("Hat", "Hat sprite for new joystick."), this.hatSprite);
            }
            else
            {
                this.defaultSprite = DrawSpriteBox(new GUIContent("Sprite", "Sprite for new joystick."), this.defaultSprite);
            }

            EditorGUILayout.Space();

            EditorGUILayout.EndHorizontal();

            InspectorUtils.EndIndentedSection();
        }
        // ------------------
        public void Draw(JoystickStateBinding bind, InputRig rig)
        {
            bool bindingEnabled = bind.enabled;

            EditorGUILayout.BeginVertical();

            if (bindingEnabled = EditorGUILayout.ToggleLeft(this.labelContent, bindingEnabled, GUILayout.MinWidth(30)))
            {
                InspectorUtils.BeginIndentedSection();

                this.horzAxisInspector.Draw(bind.horzAxisBinding, rig);
                this.vertAxisInspector.Draw(bind.vertAxisBinding, rig);


                this.dirInspector.Draw(bind.dirBinding, rig);

                InspectorUtils.EndIndentedSection();

                GUILayout.Space(InputBindingGUIUtils.VERT_MARGIN);
            }

            EditorGUILayout.EndVertical();


            if ((bindingEnabled != bind.enabled))
            {
                CFGUI.CreateUndo("Joy State Binding modification.", this.undoObject);

                bind.enabled = bindingEnabled;

                CFGUI.EndUndo(this.undoObject);
            }
        }
        // -----------------
        virtual protected void DrawNameGUI()
        {
            InspectorUtils.BeginIndentedSection();     //this.GetTitle());

            this.controlName = CFGUI.TextField(new GUIContent("Name"), this.controlName, MAX_LABEL_WIDTH);

            InspectorUtils.EndIndentedSection();
        }
Ejemplo n.º 9
0
            // ---------------------
            public void Draw()
            {
                InspectorUtils.BeginIndentedSection(new GUIContent(this.prefix + " Binding Setup"));

                this.gestureBindingInsp.Draw(this.gestureBinding, null, this.wizard.panel.rig);


                InspectorUtils.EndIndentedSection();
            }
Ejemplo n.º 10
0
        // ---------------------
        override protected void DrawBindingGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Binding"));

            this.pressBindingInsp.Draw(this.pressBinding, this.panel.rig);
            this.toggleBindingInsp.Draw(this.toggleBinding, this.panel.rig);

            InspectorUtils.EndIndentedSection();
        }
Ejemplo n.º 11
0
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchTrackPad c = (TouchTrackPad)this.target;

            float
                touchSmoothing = c.touchSmoothing;

            this.emulateTouchPressure = c.emulateTouchPressure;

            GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerTrackPad, GUILayout.ExpandWidth(true));


            this.DrawWarnings(c);



            //Trackpad inspector....

            InspectorUtils.BeginIndentedSection(new GUIContent("TrackPad Settings"));

            touchSmoothing = CFGUI.Slider(new GUIContent("Touch smoothing", "Amount of smoothing applied to touch position. "),
                                          touchSmoothing, 0, 1, 110);

            InspectorUtils.EndIndentedSection();


            InspectorUtils.BeginIndentedSection(new GUIContent("TrackPad Bindings"));


            this.pressBindingInsp.Draw(c.pressBinding, c.rig);
            this.touchPressureBindingInsp.Draw(c.touchPressureBinding, c.rig);
            this.horzSwipeBindingInsp.Draw(c.horzSwipeBinding, c.rig);
            this.vertSwipeBindingInsp.Draw(c.vertSwipeBinding, c.rig);

            InspectorUtils.EndIndentedSection();


            // Register Undo...

            if ((touchSmoothing != c.touchSmoothing) ||
                (this.emulateTouchPressure != c.emulateTouchPressure))
            {
                CFGUI.CreateUndo("Dynamic Touch Control modification.", c);

                c.SetTouchSmoothing(touchSmoothing);

                c.emulateTouchPressure = this.emulateTouchPressure;

                CFGUI.EndUndo(c);
            }


            // Draw Shared Control Params...

            this.DrawTouchContolGUI(c);
        }
Ejemplo n.º 12
0
        // ---------------------
        override protected void DrawBindingGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Binding Settings"));

            this.pressBindingInsp.Draw(this.pressBinding, this.panel.rig);

            this.horzDeltaBindingInsp.Draw(this.horzDeltaBinding, this.panel.rig);
            this.vertDeltaBindingInsp.Draw(this.vertDeltaBinding, this.panel.rig);

            InspectorUtils.EndIndentedSection();
        }
Ejemplo n.º 13
0
        // ---------------------
        override protected void DrawBindingGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Binding Settings"));

            for (int i = 0; i < this.fingerBinding.Length; ++i)
            {
                this.fingerBinding[i].Draw();
            }


            InspectorUtils.EndIndentedSection();
        }
        // ----------------
        virtual protected void DrawPresentationGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Presentation"));

            EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
            EditorGUILayout.Space();
            this.defaultSprite = DrawSpriteBox(new GUIContent("Sprite", "Simple single sprite for new control."), this.defaultSprite);
            EditorGUILayout.Space();
            EditorGUILayout.EndHorizontal();

            InspectorUtils.EndIndentedSection();
        }
Ejemplo n.º 15
0
        // ---------------------
        override protected void DrawBindingGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Binding"));

            this.pressBindingInsp.Draw(this.pressBinding, this.panel.rig);

            //this.joyNameBindingInsp.Draw(this.joyNameBinding, this.panel.rig);

            this.horzAxisBindingInsp.Draw(this.horzAxisBinding, this.panel.rig);
            this.vertAxisBindingInsp.Draw(this.vertAxisBinding, this.panel.rig);

            InspectorUtils.EndIndentedSection();
        }
Ejemplo n.º 16
0
        // ---------------
        public override void OnInspectorGUI()
        {
            GamepadManager m = (GamepadManager)this.target;


            // Gamepad Manager GUI...

            float
                connectionCheckInterval = m.connectionCheckInterval;
            bool
                dontDestroyOnLoad = m.dontDestroyOnLoad;


            GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerGamepadManager, GUILayout.ExpandWidth(true));


            EditorGUILayout.Space();

            InspectorUtils.BeginIndentedSection(new GUIContent("Settings"));

            connectionCheckInterval = CFGUI.FloatFieldEx(new GUIContent("Connection Check Interval (ms)", "Gamepad connection Check Interval in milliseconds.\nEach call of Input.GetJoystickNames() allocates at least 40 bytes - that's not much, but..."),
                                                         connectionCheckInterval, 0, 10, 1000, true, 190);

            dontDestroyOnLoad = EditorGUILayout.ToggleLeft(new GUIContent("Don't destroy on load.", "This game object will not be destroyed when new scene/level is loaded."),
                                                           dontDestroyOnLoad);

            InspectorUtils.EndIndentedSection();


            EditorGUILayout.Space();


            // Register undo...

            if (    //(gamepadOrderMode			!= m.gamepadOrderMode)
                (connectionCheckInterval != m.connectionCheckInterval) ||
                (dontDestroyOnLoad != m.dontDestroyOnLoad)

                )
            {
                CFGUI.CreateUndo("CF2 Gamepad Manager modification", m);

                //m.gamepadOrderMode		 = gamepadOrderMode;

                m.connectionCheckInterval = connectionCheckInterval;
                m.dontDestroyOnLoad       = dontDestroyOnLoad;

                CFGUI.EndUndo(m);
            }
        }
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchJoystick c = (TouchJoystick)this.target;

            this.emulateTouchPressure = c.emulateTouchPressure;

            this.DrawWarnings(c);

            // Joystick GUI...


            GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerJoystick, GUILayout.ExpandWidth(true));

            // Steering Wheel specific inspector....

            InspectorUtils.BeginIndentedSection(new GUIContent("Joystick Settings"));

            this.joyConfigInsp.DrawGUI(c.config);

            InspectorUtils.EndIndentedSection();


            InspectorUtils.BeginIndentedSection(new GUIContent("Joystick Bindings"));


            this.pressBindingInsp.Draw(c.pressBinding, c.rig);
            this.touchPressureBindingInsp.Draw(c.touchPressureBinding, c.rig);

            this.joyStateBindingInsp.Draw(c.joyStateBinding, c.rig);

            InspectorUtils.EndIndentedSection();


            // Register Undo...

            if ((this.emulateTouchPressure != c.emulateTouchPressure))
            {
                CFGUI.CreateUndo("Dynamic Touch Control modification.", c);

                c.emulateTouchPressure = this.emulateTouchPressure;

                CFGUI.EndUndo(c);
            }


            // Draw Shared Dynamic Control Params...

            this.DrawDynamicTouchControlGUI(c);
        }
        // ---------------------
        override protected void DrawBindingGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Binding Settings"));

            this.pressBindingInsp.Draw(this.pressBinding, this.panel.rig);
            this.touchPressureBindingInsp.Draw(this.touchPressureBinding, this.panel.rig);

            this.turnBindingInsp.Draw(this.turnBinding, this.panel.rig);

            this.turnLeftBindingInsp.Draw(this.turnLeftBinding, this.panel.rig);
            this.turnRightBindingInsp.Draw(this.turnRightBinding, this.panel.rig);


            InspectorUtils.EndIndentedSection();
        }
        // ---------------
        public override void OnInspectorGUI()
        {
            SuperTouchZoneSpriteAnimator target = this.target as SuperTouchZoneSpriteAnimator;

            if ((target == null))
            {
                return;
            }

            if (!TouchControlSpriteAnimatorInspector.DrawSourceGUI(target))
            {
                return;
            }

            //TouchControlSpriteAnimatorInspector.DrawTimingGUI(target);



            InspectorUtils.BeginIndentedSection(new GUIContent("Sprite Settings"));

            if (this.spriteConfigInspArray != null)
            {
                for (SuperTouchZoneSpriteAnimator.ControlState i = SuperTouchZoneSpriteAnimator.ControlStateFirst;
                     i < SuperTouchZoneSpriteAnimator.ControlStateCount; ++i)
                {
                    if (this.spriteConfigInspArray[(int)i] == null)
                    {
                        EditorGUILayout.LabelField("ERROR");
                    }
                    else
                    {
                        this.spriteConfigInspArray[(int)i].Draw(target.GetStateSpriteConfig(i), target, ((int)i == 0), ((int)i != 0));
                    }
                }
            }
//
//			this.spriteNeutral.Draw(target.spriteNeutral, target, true);
//
//			EditorGUILayout.Space();
//			this.spritePressed.Draw(target.spritePressed, target, target.IsIllegallyAttachedToSource());


            InspectorUtils.EndIndentedSection();


            //TouchControlSpriteAnimatorInspector.DrawDefaultTransformGUI(target);
        }
Ejemplo n.º 20
0
        // -----------------------
        public void DrawGUI()
        {
            bool
                disableWhenTouchScreenInactive = this.target.disableWhenTouchScreenInactive,
                disableWhenCursorIsUnlocked    = this.target.disableWhenCursorIsUnlocked;

            DisablingConditionSet.MobileModeRelation
                mobileModeRelation = this.target.mobileModeRelation;


            InspectorUtils.BeginIndentedSection(this.titleContent);

            mobileModeRelation = (DisablingConditionSet.MobileModeRelation)CFGUI.EnumPopup(new GUIContent("Mobile Mode Relation"),
                                                                                           mobileModeRelation, 130);

            disableWhenCursorIsUnlocked = EditorGUILayout.ToggleLeft(new GUIContent("Disable when Cursor is unlocked", "Disable this element when mouse cursor is unlocked. \nUse this option if your game is using cursor lock state to display menus and things like that..."),
                                                                     disableWhenCursorIsUnlocked);
            disableWhenTouchScreenInactive = EditorGUILayout.ToggleLeft(new GUIContent("Disable when Touch Screen is inactive", "Disable this element when touch screen hasn't been used for some time (Check out Input Rig's General Settings)."),
                                                                        disableWhenTouchScreenInactive);

            EditorGUILayout.Space();

            if (this.switchListInsp != null)
            {
                this.switchListInsp.DrawGUI();
            }


            InspectorUtils.EndIndentedSection();



            // Refister undo...

            if ((mobileModeRelation != this.target.mobileModeRelation) ||
                (disableWhenCursorIsUnlocked != this.target.disableWhenCursorIsUnlocked) ||
                (disableWhenTouchScreenInactive != this.target.disableWhenTouchScreenInactive))
            {
                CFGUI.CreateUndo("Disabling Conditions modification", this.undoObject);

                this.target.mobileModeRelation             = mobileModeRelation;
                this.target.disableWhenCursorIsUnlocked    = disableWhenCursorIsUnlocked;
                this.target.disableWhenTouchScreenInactive = disableWhenTouchScreenInactive;

                CFGUI.EndUndo(this.undoObject);
            }
        }
Ejemplo n.º 21
0
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchButtonSpriteAnimator target = this.target as TouchButtonSpriteAnimator;

            if ((target == null))
            {
                return;
            }



            if (!TouchControlSpriteAnimatorInspector.DrawSourceGUI(target))
            {
                return;
            }



            if (target.sourceControl == null)
            {
            }               //InspectorUtils.DrawErrorBox("Source Button is not connected!");
            else
            {
                InspectorUtils.BeginIndentedSection(new GUIContent("Sprite Settings"));



                this.spriteNeutral.Draw(target.spriteNeutral, target, true, false);

                {
                    EditorGUILayout.Space();
                    this.spritePressed.Draw(target.spritePressed, target, target.IsIllegallyAttachedToSource());

                    if (((TouchButton)target.sourceControl).toggle)
                    {
                        EditorGUILayout.Space();
                        this.spriteToggled.Draw(target.spriteToggled, target, target.IsIllegallyAttachedToSource());

                        EditorGUILayout.Space();
                        this.spriteToggledAndPressed.Draw(target.spriteToggledAndPressed, target, target.IsIllegallyAttachedToSource());
                    }
                }

                InspectorUtils.EndIndentedSection();
            }
        }
        // ----------------
        override protected void DrawPresentationGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Presentation"));

            this.createSpriteAnimator = EditorGUILayout.ToggleLeft(new GUIContent("Create Sprite Animator"), this.createSpriteAnimator);

            if (this.createSpriteAnimator)
            {
                EditorGUILayout.BeginHorizontal(GUILayout.ExpandWidth(true));
                EditorGUILayout.Space();
                this.defaultSprite = DrawSpriteBox(new GUIContent("Sprite", "Simple single sprite for new control."), this.defaultSprite);
                EditorGUILayout.Space();
                EditorGUILayout.EndHorizontal();
            }

            InspectorUtils.EndIndentedSection();
        }
        // -------------------
        virtual protected void DrawPositionAndModeGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Positioning"));

            this.dynamicMode = (ControlMode)CFGUI.EnumPopup(new GUIContent("Mode", "Positioning Mode - Static or Dynamic?"),
                                                            this.dynamicMode, MAX_LABEL_WIDTH);

            //EditorGUILayout.Toggle(new GUIContent("Dynamic Mode", "Create this control with it's own DynamicRegion."),
            //this.dynamicWithRegion, GUILayout.ExpandWidth(true));

            if (this.dynamicMode == ControlMode.DynamicWithRegion)
            {
                this.regionRect = (RegionRectPreset)CFGUI.EnumPopup(new GUIContent("Region", "Select Dynamic Region's screen position."),
                                                                    this.regionRect, MAX_LABEL_WIDTH);
            }
            else
            {
                this.staticAnchor = (ControlAnchorPoint)CFGUI.EnumPopup(new GUIContent("Anchor", "New control will be automatically placed near selected anchor point."),
                                                                        this.staticAnchor, MAX_LABEL_WIDTH);
            }

            this.controlShape = (TouchControl.Shape)CFGUI.EnumPopup(new GUIContent("Shape", "Control's shape"), this.controlShape, MAX_LABEL_WIDTH);

            this.controlSize = CFGUI.Slider(new GUIContent("Size", "Control's size relative to the shorter dimension of parent canvas."),
                                            this.controlSize, 0.05f, 0.5f, MAX_LABEL_WIDTH);


            this.controlDepth = (float)DrawDepthSlider(new GUIContent("Control Depth", "Depth of the control - how far to push the control into the screen.\n\nControls of depth closer to screen (smaller values) are picked first!"),
                                                       this.controlDepth, MAX_LABEL_WIDTH);

            if (this.dynamicMode == ControlMode.DynamicWithRegion)
            {
                this.regionDepth = (float)DrawDepthSlider(new GUIContent("Region Depth", "Depth of control's dynamic region. It's recommended to use higher depth for region than for the control itself.\n\nControls of depth closer to screen (smaller values) are picked first!"),
                                                          this.regionDepth, MAX_LABEL_WIDTH);
            }


            InspectorUtils.EndIndentedSection();
        }
        // ---------------------
        override protected void DrawPositionAndModeGUI()
        {
            InspectorUtils.BeginIndentedSection(new GUIContent("Positioning"));

            this.positionMode = (PositionMode)CFGUI.EnumPopup(new GUIContent("Mode", "Positioning Mode - Const Size or Stretchy Screen Region?"),
                                                              this.positionMode, MAX_LABEL_WIDTH);

            if (this.positionMode == PositionMode.Stretch)
            {
                this.regionRect = (RegionRectPreset)CFGUI.EnumPopup(new GUIContent("Region", "Select Dynamic Region's screen position."),
                                                                    this.regionRect, MAX_LABEL_WIDTH);
            }
            else
            {
                this.staticAnchor = (ControlAnchorPoint)CFGUI.EnumPopup(new GUIContent("Anchor", "New control will be automatically placed near selected anchor point."),
                                                                        this.staticAnchor, MAX_LABEL_WIDTH);

                this.controlSize = CFGUI.Slider(new GUIContent("Size", "Control's size relative to the shorter dimension of parent canvas."),
                                                this.controlSize, 0.05f, 0.5f, MAX_LABEL_WIDTH);
            }

            this.controlShape = (TouchControl.Shape)CFGUI.EnumPopup(new GUIContent("Shape", "Control's shape"), this.controlShape, MAX_LABEL_WIDTH);


            if (this.positionMode == PositionMode.Stretch)
            {
                this.regionDepth = (float)DrawDepthSlider(new GUIContent("Control Depth", "Depth of the control - how far to push the control into the screen.\n\nControls of depth closer to screen (smaller values) are picked first!"),
                                                          this.regionDepth, MAX_LABEL_WIDTH);
            }
            else
            {
                this.controlDepth = (float)DrawDepthSlider(new GUIContent("Control Depth", "Depth of the control - how far to push the control into the screen.\n\nControls of depth closer to screen (smaller values) are picked first!"),
                                                           this.controlDepth, MAX_LABEL_WIDTH);
            }



            InspectorUtils.EndIndentedSection();
        }
Ejemplo n.º 25
0
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchSplitter c = (TouchSplitter)this.target;

            this.DrawWarnings(c);



            GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerTouchSplitter, GUILayout.ExpandWidth(true));

            // Steering Wheel specific inspector....

            InspectorUtils.BeginIndentedSection(new GUIContent("Target Controls"));

            this.targetControlListInsp.DrawGUI();

            InspectorUtils.EndIndentedSection();



            // Draw Shared Touch Control Params...

            this.DrawTouchContolGUI(c);
        }
Ejemplo n.º 26
0
        // ---------------
        public override void OnInspectorGUI()
        {
            ControlFreak2.SuperTouchZone c = (ControlFreak2.SuperTouchZone) this.target;

            GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerTouchZone, GUILayout.ExpandWidth(true));


            this.DrawWarnings(c);



            int
                maxFingers = c.maxFingers;
            float
                strictMultiTouchTime = c.strictMultiTouchTime;
            float
                touchSmoothing = c.touchSmoothing;
            bool
                strictMultiTouch        = c.strictMultiTouch,
                freezeTwistWhenTooClose = c.freezeTwistWhenTooClose,
                noPinchAfterDrag        = c.noPinchAfterDrag,
                noPinchAfterTwist       = c.noPinchAfterTwist,
                noTwistAfterDrag        = c.noTwistAfterDrag,
                noTwistAfterPinch       = c.noTwistAfterPinch,
                noDragAfterPinch        = c.noDragAfterPinch,
                noDragAfterTwist        = c.noDragAfterTwist,
                startPinchWhenTwisting  = c.startPinchWhenTwisting,
                startPinchWhenDragging  = c.startPinchWhenDragging,
                startDragWhenPinching   = c.startDragWhenPinching,
                startDragWhenTwisting   = c.startDragWhenTwisting,
                startTwistWhenDragging  = c.startTwistWhenDragging,
                startTwistWhenPinching  = c.startTwistWhenPinching;

            ControlFreak2.SuperTouchZone.GestureDetectionOrder
                gestureDetectionOrder = c.gestureDetectionOrder;



            bool
                emuWithKeys = c.emuWithKeys;
            KeyCode
                emuKeyOneFinger         = c.emuKeyOneFinger,
                emuKeyTwoFingers        = c.emuKeyTwoFingers,
                emuKeyThreeFingers      = c.emuKeyThreeFingers,
                emuKeySwipeU            = c.emuKeySwipeU,
                emuKeySwipeR            = c.emuKeySwipeR,
                emuKeySwipeD            = c.emuKeySwipeD,
                emuKeySwipeL            = c.emuKeySwipeL,
                emuKeyTwistR            = c.emuKeyTwistR,
                emuKeyTwistL            = c.emuKeyTwistL,
                emuKeyPinch             = c.emuKeyPinch,
                emuKeySpread            = c.emuKeySpread,
                emuMouseTwoFingersKey   = c.emuMouseTwoFingersKey,
                emuMouseTwistKey        = c.emuMouseTwistKey,
                emuMousePinchKey        = c.emuMousePinchKey,
                emuMouseThreeFingersKey = c.emuMouseThreeFingersKey;

            ControlFreak2.SuperTouchZone.EmuMouseAxis
                emuMousePinchAxis = c.emuMousePinchAxis,
                emuMouseTwistAxis = c.emuMouseTwistAxis;

            float
                emuKeySwipeSpeed          = c.emuKeySwipeSpeed,
                emuKeyPinchSpeed          = c.emuKeyPinchSpeed,
                emuKeyTwistSpeed          = c.emuKeyTwistSpeed,
                mouseEmuTwistScreenFactor = c.mouseEmuTwistScreenFactor;



            if (InspectorUtils.BeginIndentedSection(new GUIContent("Touch Zone Settings"), ref this.settingsFoldedOut))
            {
                maxFingers = CFGUI.IntSlider(new GUIContent("Max finger number", "Maximal number of fingers allowed at the same time."),
                                             maxFingers, 1, ControlFreak2.SuperTouchZone.MAX_FINGERS, 120);

                touchSmoothing = CFGUI.Slider(new GUIContent("Touch. smoothing", "Amount of smoothing applied to controlling touch position. "),
                                              touchSmoothing, 0, 1, 120);



                if (maxFingers >= 2)
                {
                    EditorGUILayout.Space();

                    InspectorUtils.BeginIndentedSection(new GUIContent("Multi-finger Gesture Settings"));

                    strictMultiTouch = EditorGUILayout.ToggleLeft(new GUIContent("Strict multi-touch", "Use strict rules when detecting multi-finger touch gestures."),
                                                                  strictMultiTouch);

                    if (strictMultiTouch)
                    {
                        strictMultiTouchTime = CFGUI.FloatFieldEx(new GUIContent("Strict multi-touch time", "Time in milliseconds to wait for more fingers when starting a multi-finger touch. Touh zone will wait (and not report the fingers already pressed) until time runs out or any of the fingers already pressed moves."),
                                                                  strictMultiTouchTime, 0, 1.0f, 1000, true, 150);
                    }

                    freezeTwistWhenTooClose = EditorGUILayout.ToggleLeft(new GUIContent("Freeze twist when too close.", "Freeze Twist angle when two fingers get too close."),
                                                                         freezeTwistWhenTooClose);

                    EditorGUILayout.Space();

                    noPinchAfterDrag = EditorGUILayout.ToggleLeft(new GUIContent("No Pinch after Swipe.", "Don't allow Pinch gesture to activate after swipe has been detected."),
                                                                  noPinchAfterDrag);
                    noPinchAfterTwist = EditorGUILayout.ToggleLeft(new GUIContent("No Pinch after Twist.", "Don't allow Pinch gesture to activate after twist has been detected."),
                                                                   noPinchAfterTwist);

                    EditorGUILayout.Space();

                    noTwistAfterDrag = EditorGUILayout.ToggleLeft(new GUIContent("No Twist after Swipe.", "Don't allow Twist gesture to activate after swipe has been detected."),
                                                                  noTwistAfterDrag);
                    noTwistAfterPinch = EditorGUILayout.ToggleLeft(new GUIContent("No Twist after Pinch.", "Don't allow Twist gesture to activate after pinch has been detected."),
                                                                   noTwistAfterPinch);

                    EditorGUILayout.Space();

                    noDragAfterPinch = EditorGUILayout.ToggleLeft(new GUIContent("No Swipe after Pinch.", "Don't allow Swipe gesture to activate after pinch has been detected."),
                                                                  noDragAfterPinch);
                    noDragAfterTwist = EditorGUILayout.ToggleLeft(new GUIContent("No Swipe after Twist.", "Don't allow Swipe gesture to activate after twist has been detected."),
                                                                  noDragAfterTwist);

                    EditorGUILayout.Space();


                    startPinchWhenTwisting = EditorGUILayout.ToggleLeft(new GUIContent("Start Pinch when Twisting", "Auto-activate Pinch gesture when Twist gesture has been detected."),
                                                                        startPinchWhenTwisting);
                    startPinchWhenDragging = EditorGUILayout.ToggleLeft(new GUIContent("Start Pinch when Swiping", "Auto-activate Pinch gesture when Swipe gesture has been detected."),
                                                                        startPinchWhenDragging);
                    EditorGUILayout.Space();

                    startDragWhenPinching = EditorGUILayout.ToggleLeft(new GUIContent("Start Swipe when Pinching", "Auto-activate Swipe gesture when Pinch gesture has been detected."),
                                                                       startDragWhenPinching);
                    startDragWhenTwisting = EditorGUILayout.ToggleLeft(new GUIContent("Start Swipe when Twisting", "Auto-activate Swipe gesture when Twist gesture has been detected."),
                                                                       startDragWhenTwisting);
                    EditorGUILayout.Space();

                    startTwistWhenDragging = EditorGUILayout.ToggleLeft(new GUIContent("Start Twist when Swiping", "Auto-activate Twist esture when Swipe gesture has been detected."),
                                                                        startTwistWhenDragging);
                    startTwistWhenPinching = EditorGUILayout.ToggleLeft(new GUIContent("Start Twist when Pinching", "Auto-activate Twist gesture when Pinching gesture has been detected."),
                                                                        startTwistWhenPinching);
                    EditorGUILayout.Space();



                    gestureDetectionOrder = (SuperTouchZone.GestureDetectionOrder)CFGUI.EnumPopup(new GUIContent("Gesture detect. order",
                                                                                                                 "Gesture Detection Order. Useful is you don't allow some gesture combinations at the same time."), gestureDetectionOrder, 130);

                    InspectorUtils.EndIndentedSection();
                }


                // Thresholds...

                EditorGUILayout.Space();

                this.touchThreshInsp.DrawGUI(c.customThresh);

                // Finger configs...

                for (int i = 0; i < Mathf.Min(c.maxFingers, this.multiFingerConfigInspArray.Length); ++i)
                {
                    EditorGUILayout.Space();

                    this.multiFingerConfigInspArray[i].DrawConfigGUI(c.multiFingerConfigs[i]);
                }



                InspectorUtils.EndIndentedSection();
            }



            EditorGUILayout.Space();

            if (InspectorUtils.BeginIndentedSection(new GUIContent("Touch Zone Bindings"), ref this.multiFingerBindingsFoldedOut))
            {
                //InspectorUtils.BeginIndentedSection(new GUIContent("Touch Zone Bindings"));
                //	if (InspectorUtils.BeginIndentedSection(new GUIContent("Multi-Finger Touch Bindings"), ref this.multiFingerBindingsFoldedOut))
                //		{


                for (int i = 0; i < Mathf.Min(c.maxFingers, this.multiFingerConfigInspArray.Length); ++i)
                {
                    this.multiFingerConfigInspArray[i].DrawBindingGUI(c.multiFingerConfigs[i]);
                    EditorGUILayout.Space();
                }

                //InspectorUtils.EndIndentedSection();
                //}

                if (maxFingers >= 2)
                {
                    if (InspectorUtils.BeginIndentedSection(new GUIContent("Twist and Pinch Bindings"), ref this.twistAndPinchBindingFoldedOut))
                    {
                        this.twistAnalogBindingInsp.Draw(c.twistAnalogBinding, c.rig);
                        this.twistDeltaBindingInsp.Draw(c.twistDeltaBinding, c.rig);
                        //this.twistKeyBindingInsp.Draw(c.twistKeyBinding, c.rig);

                        this.twistRightDigitalBindingInsp.Draw(c.twistRightDigitalBinding, c.rig);
                        this.twistLeftDigitalBindingInsp.Draw(c.twistLeftDigitalBinding, c.rig);

                        this.twistScrollDeltaBindingInsp.Draw(c.twistScrollDeltaBinding, c.rig);


                        EditorGUILayout.Space();

                        this.pinchAnalogBindingInsp.Draw(c.pinchAnalogBinding, c.rig);
                        this.pinchDeltaBindingInsp.Draw(c.pinchDeltaBinding, c.rig);
                        //this.pinchKeyBindingInsp.Draw(c.pinchKeyBinding, c.rig);

                        this.pinchDigitalBindingInsp.Draw(c.pinchDigitalBinding, c.rig);
                        this.spreadDigitalBindingInsp.Draw(c.spreadDigitalBinding, c.rig);

                        this.pinchScrollDeltaBindingInsp.Draw(c.pinchScrollDeltaBinding, c.rig);

                        InspectorUtils.EndIndentedSection();
                    }
                }


                EditorGUILayout.Space();

                InspectorUtils.BeginIndentedSection(new GUIContent("Misc. Touch Zone Bindings"));


                this.separateFingersAsEmuTouchesBindingInsp.Draw(c.separateFingersAsEmuTouchesBinding, c.rig);

                InspectorUtils.EndIndentedSection();

                InspectorUtils.EndIndentedSection();
            }


            EditorGUILayout.Space();


            if (InspectorUtils.BeginIndentedSection(new GUIContent("Keyboard Settings"), ref this.keyboardFoldedOut))
            {
                emuWithKeys = EditorGUILayout.ToggleLeft(new GUIContent("Keyboard control", "Use keyboard to control this touch control."),
                                                         emuWithKeys);

                const float KEY_LABEL_WIDTH = 120;

                if (emuWithKeys)
                {
                    emuKeyOneFinger = (KeyCode)CFGUI.EnumPopup(new GUIContent("One Finger Press", "Static press with one finger."),
                                                               emuKeyOneFinger, KEY_LABEL_WIDTH);

                    if (maxFingers >= 2)
                    {
                        emuKeyTwoFingers = (KeyCode)CFGUI.EnumPopup(new GUIContent("Two Finger Press", "Static press with two fingers."),
                                                                    emuKeyTwoFingers, KEY_LABEL_WIDTH);
                    }

                    if (maxFingers >= 3)
                    {
                        emuKeyThreeFingers = (KeyCode)CFGUI.EnumPopup(new GUIContent("Three Finger Press", "Static press with three fingers."),
                                                                      emuKeyThreeFingers, KEY_LABEL_WIDTH);
                    }

                    EditorGUILayout.Space();

                    emuKeySwipeU = (KeyCode)CFGUI.EnumPopup(new GUIContent("Swipe Up", "Swipe Up.\nNote: you can start a multi-finger press with one of keys defined above and then simulate swipe with one of these keys."),
                                                            emuKeySwipeU, KEY_LABEL_WIDTH);
                    emuKeySwipeR = (KeyCode)CFGUI.EnumPopup(new GUIContent("Swipe Right", "Swipe Right.\nNote: you can start a multi-finger press with one of keys defined above and then simulate swipe with one of these keys."),
                                                            emuKeySwipeR, KEY_LABEL_WIDTH);
                    emuKeySwipeD = (KeyCode)CFGUI.EnumPopup(new GUIContent("Swipe Down", "Swipe Down.\nNote: you can start a multi-finger press with one of keys defined above and then simulate swipe with one of these keys."),
                                                            emuKeySwipeD, KEY_LABEL_WIDTH);
                    emuKeySwipeL = (KeyCode)CFGUI.EnumPopup(new GUIContent("Swipe Left", "Swipe Left.\nNote: you can start a multi-finger press with one of keys defined above and then simulate swipe with one of these keys."),
                                                            emuKeySwipeL, KEY_LABEL_WIDTH);


                    if (maxFingers >= 2)
                    {
                        EditorGUILayout.Space();

                        emuKeyTwistR = (KeyCode)CFGUI.EnumPopup(new GUIContent("Twist Right", "Start a two-finger press and twist clockwise.\nNote: This can be combined with pinching and swiping!"),
                                                                emuKeyTwistR, KEY_LABEL_WIDTH);
                        emuKeyTwistL = (KeyCode)CFGUI.EnumPopup(new GUIContent("Twist Left", "Start a two-finger press and twist counter-colckwise.\nNote: This can be combined with pinching and swiping!"),
                                                                emuKeyTwistL, KEY_LABEL_WIDTH);

                        emuKeyPinch = (KeyCode)CFGUI.EnumPopup(new GUIContent("Pinch", "Start a two-finger press and pinch them together.\nNote: This can be combined with twisting and swiping!"),
                                                               emuKeyPinch, KEY_LABEL_WIDTH);
                        emuKeySpread = (KeyCode)CFGUI.EnumPopup(new GUIContent("Spread", "Start a two-finger press and spread them apart.\nNote: This can be combined with twisting and swiping!"),
                                                                emuKeySpread, KEY_LABEL_WIDTH);

                        emuKeySwipeSpeed = CFGUI.Slider(new GUIContent("Key Swipe Speed", "Keyboard swipe speed in screen widths per second."),
                                                        emuKeySwipeSpeed, 0.1f, 1.0f, KEY_LABEL_WIDTH);
                        emuKeyPinchSpeed = CFGUI.Slider(new GUIContent("Key Pinch Speed", "Keyboard pinch speed in screen widths per second."),
                                                        emuKeyPinchSpeed, 0.1f, 1.0f, KEY_LABEL_WIDTH);
                        emuKeyTwistSpeed = CFGUI.Slider(new GUIContent("Key Twist Speed", "Keyboard twist speed in degrees per second."),
                                                        emuKeyTwistSpeed, 25, 360, KEY_LABEL_WIDTH);


                        EditorGUILayout.Space();

                        emuMouseTwoFingersKey = (KeyCode)CFGUI.EnumPopup(new GUIContent("2-finger mouse mod.", "Holding this key and clicking with a mouse will start two virtual touches."),
                                                                         emuMouseTwoFingersKey, KEY_LABEL_WIDTH);

                        if (maxFingers >= 3)
                        {
                            emuMouseThreeFingersKey = (KeyCode)CFGUI.EnumPopup(new GUIContent("3-finger mouse mod.", "Holding this key and clicking with a mouse will start three virtual touches."),
                                                                               emuMouseThreeFingersKey, KEY_LABEL_WIDTH);
                        }

                        EditorGUILayout.Space();

                        emuMouseTwistKey = (KeyCode)CFGUI.EnumPopup(new GUIContent("Twist mouse mod.", "Twist mouse modifier. Holding this key and clicking with a mouse will start two virtual touches. Dragging the mouse along axis selected below will simulate twist."),
                                                                    emuMouseTwistKey, KEY_LABEL_WIDTH);

                        emuMousePinchKey = (KeyCode)CFGUI.EnumPopup(new GUIContent("Pinch mouse mod.", "Pinch mouse modifier. Holding this key and clicking with a mouse will start two virtual touches. Dragging the mouse along axis selected below will simulate pinch."),
                                                                    emuMousePinchKey, KEY_LABEL_WIDTH);

                        emuMouseTwistAxis = (ControlFreak2.SuperTouchZone.EmuMouseAxis)CFGUI.EnumPopup(new GUIContent("Mouse twist axis", "Select mouse drag axis to simulate twist.\nNote: If twist and pinch axes are not the same, twist and pinch mouse modifers can be combined to twist and pinch with a mouse at the same time."),
                                                                                                       emuMouseTwistAxis, KEY_LABEL_WIDTH);
                        emuMousePinchAxis = (ControlFreak2.SuperTouchZone.EmuMouseAxis)CFGUI.EnumPopup(new GUIContent("Mouse pinch axis", "Select mouse drag axis to simulate pinch.\nNote: If twist and pinch axes are not the same, twist and pinch mouse modifers can be combined to twist and pinch with a mouse at the same time."),
                                                                                                       emuMousePinchAxis, KEY_LABEL_WIDTH);


                        mouseEmuTwistScreenFactor = CFGUI.Slider(new GUIContent("Mouse Twist Factor", "Fraction of screen width to drag to twist virtual fingers by 360 degrees."),
                                                                 mouseEmuTwistScreenFactor, 0.2f, 1.0f, KEY_LABEL_WIDTH);
                    }
                }

                InspectorUtils.EndIndentedSection();
            }


            // Register undo...



            if ((maxFingers != c.maxFingers) ||
                (touchSmoothing != c.touchSmoothing) ||
                (strictMultiTouchTime != c.strictMultiTouchTime) ||
                (strictMultiTouch != c.strictMultiTouch) ||
                (freezeTwistWhenTooClose != c.freezeTwistWhenTooClose) ||
                (noPinchAfterDrag != c.noPinchAfterDrag) ||
                (noPinchAfterTwist != c.noPinchAfterTwist) ||
                (noTwistAfterDrag != c.noTwistAfterDrag) ||
                (noTwistAfterPinch != c.noTwistAfterPinch) ||
                (noDragAfterPinch != c.noDragAfterPinch) ||
                (noDragAfterTwist != c.noDragAfterTwist) ||
                (startPinchWhenTwisting != c.startPinchWhenTwisting) ||
                (startPinchWhenDragging != c.startPinchWhenDragging) ||
                (startDragWhenPinching != c.startDragWhenPinching) ||
                (startDragWhenTwisting != c.startDragWhenTwisting) ||
                (startTwistWhenDragging != c.startTwistWhenDragging) ||
                (startTwistWhenPinching != c.startTwistWhenPinching) ||
                (gestureDetectionOrder != c.gestureDetectionOrder) ||
                //(bindSeparateFingersToEmuTouches	!= c.bindSeparateFingersToEmuTouches) ||
//			(twistBindMode			!= c.twistBindMode) ||
//			(pinchBindMode			!= c.pinchBindMode) ||
                (emuWithKeys != c.emuWithKeys) ||
                (emuKeyOneFinger != c.emuKeyOneFinger) ||
                (emuKeyTwoFingers != c.emuKeyTwoFingers) ||
                (emuKeyThreeFingers != c.emuKeyThreeFingers) ||
                (emuKeySwipeU != c.emuKeySwipeU) ||
                (emuKeySwipeR != c.emuKeySwipeR) ||
                (emuKeySwipeD != c.emuKeySwipeD) ||
                (emuKeySwipeL != c.emuKeySwipeL) ||
                (emuKeyTwistR != c.emuKeyTwistR) ||
                (emuKeyTwistL != c.emuKeyTwistL) ||
                (emuKeyPinch != c.emuKeyPinch) ||
                (emuKeySpread != c.emuKeySpread) ||
                (emuMouseTwoFingersKey != c.emuMouseTwoFingersKey) ||
                (emuMouseTwistKey != c.emuMouseTwistKey) ||
                (emuMousePinchKey != c.emuMousePinchKey) ||
                (emuMouseThreeFingersKey != c.emuMouseThreeFingersKey) ||
                (emuMousePinchAxis != c.emuMousePinchAxis) ||
                (emuMouseTwistAxis != c.emuMouseTwistAxis) ||
                (emuKeySwipeSpeed != c.emuKeySwipeSpeed) ||
                (emuKeyPinchSpeed != c.emuKeyPinchSpeed) ||
                (emuKeyTwistSpeed != c.emuKeyTwistSpeed) ||
                (mouseEmuTwistScreenFactor != c.mouseEmuTwistScreenFactor))
            {
                CFGUI.CreateUndo("CF2 Touch Zone modification", c);

                c.maxFingers              = maxFingers;
                c.strictMultiTouchTime    = strictMultiTouchTime;
                c.strictMultiTouch        = strictMultiTouch;
                c.freezeTwistWhenTooClose = freezeTwistWhenTooClose;
                c.noPinchAfterDrag        = noPinchAfterDrag;
                c.noPinchAfterTwist       = noPinchAfterTwist;
                c.noTwistAfterDrag        = noTwistAfterDrag;
                c.noTwistAfterPinch       = noTwistAfterPinch;
                c.noDragAfterPinch        = noDragAfterPinch;
                c.noDragAfterTwist        = noDragAfterTwist;
                c.startPinchWhenTwisting  = startPinchWhenTwisting;
                c.startPinchWhenDragging  = startPinchWhenDragging;
                c.startDragWhenPinching   = startDragWhenPinching;
                c.startDragWhenTwisting   = startDragWhenTwisting;
                c.startTwistWhenDragging  = startTwistWhenDragging;
                c.startTwistWhenPinching  = startTwistWhenPinching;
                c.gestureDetectionOrder   = gestureDetectionOrder;

                if (c.touchSmoothing != touchSmoothing)
                {
                    c.SetTouchSmoothing(touchSmoothing);
                }


                c.emuWithKeys               = emuWithKeys;
                c.emuKeyOneFinger           = emuKeyOneFinger;
                c.emuKeyTwoFingers          = emuKeyTwoFingers;
                c.emuKeyThreeFingers        = emuKeyThreeFingers;
                c.emuKeySwipeU              = emuKeySwipeU;
                c.emuKeySwipeR              = emuKeySwipeR;
                c.emuKeySwipeD              = emuKeySwipeD;
                c.emuKeySwipeL              = emuKeySwipeL;
                c.emuKeyTwistR              = emuKeyTwistR;
                c.emuKeyTwistL              = emuKeyTwistL;
                c.emuKeyPinch               = emuKeyPinch;
                c.emuKeySpread              = emuKeySpread;
                c.emuMouseTwoFingersKey     = emuMouseTwoFingersKey;
                c.emuMouseTwistKey          = emuMouseTwistKey;
                c.emuMousePinchKey          = emuMousePinchKey;
                c.emuMouseThreeFingersKey   = emuMouseThreeFingersKey;
                c.emuMousePinchAxis         = emuMousePinchAxis;
                c.emuMouseTwistAxis         = emuMouseTwistAxis;
                c.emuKeySwipeSpeed          = emuKeySwipeSpeed;
                c.emuKeyPinchSpeed          = emuKeyPinchSpeed;
                c.emuKeyTwistSpeed          = emuKeyTwistSpeed;
                c.mouseEmuTwistScreenFactor = mouseEmuTwistScreenFactor;



                CFGUI.EndUndo(c);
            }


            // Draw Shared Control Params...

            this.DrawTouchContolGUI(c);
        }
Ejemplo n.º 27
0
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchButton c = (TouchButton)this.target;

            GUILayout.Box(GUIContent.none, CFEditorStyles.Inst.headerButton, GUILayout.ExpandWidth(true));

            this.DrawWarnings(c);


            bool
                toggle = c.toggle,
                linkToggleToRigSwitch = c.linkToggleToRigSwitch,
                autoToggleOff         = c.autoToggleOff,
                toggleOffWhenHiding   = c.toggleOffWhenHiding;
            float
                autoToggleOffTimeOut = c.autoToggleOffTimeOut;

            TouchButton.ToggleOnAction
                toggleOnAction = c.toggleOnAction;
            TouchButton.ToggleOffAction
                toggleOffAction = c.toggleOffAction;
            string
                toggleRigSwitchName = c.toggleRigSwitchName;

            this.emulateTouchPressure = c.emulateTouchPressure;

            // Button specific inspector....



            const float LABEL_WIDTH = 110;


            InspectorUtils.BeginIndentedSection(new GUIContent("Toggle Settings"));

            toggle = EditorGUILayout.ToggleLeft(new GUIContent("Toggle Mode", "Enable toggle mode."),
                                                toggle);

            if (toggle)
            {
                CFGUI.BeginIndentedVertical();

                toggleOnAction = (TouchButton.ToggleOnAction)CFGUI.EnumPopup(new GUIContent("Toggle On Action", "Select when toggle state should change from OFF to ON."),
                                                                             toggleOnAction, LABEL_WIDTH);
                toggleOffAction = (TouchButton.ToggleOffAction)CFGUI.EnumPopup(new GUIContent("Toggle Off Action", "Select when toggle state should change from ON to OFF."),
                                                                               toggleOffAction, LABEL_WIDTH);

                if (toggleOffAction != TouchButton.ToggleOffAction.OnTimeout)
                {
                    autoToggleOff = EditorGUILayout.ToggleLeft(new GUIContent("Auto Toggle Off", "When enabled, this button will auto-toggle off itself after specified amount of time."),
                                                               autoToggleOff);
                }

                if (autoToggleOff || toggleOffAction == TouchButton.ToggleOffAction.OnTimeout)
                {
                    CFGUI.BeginIndentedVertical();

                    autoToggleOffTimeOut = CFGUI.FloatFieldEx(new GUIContent("Timeout (ms)", "Auto-toggle off time-out in milliseconds."),
                                                              autoToggleOffTimeOut, 0.1f, 1000, 1000, true, LABEL_WIDTH);

                    CFGUI.EndIndentedVertical();
                }

                linkToggleToRigSwitch = EditorGUILayout.ToggleLeft(new GUIContent("Link toggle to Rig Switch", "Links this toggle button to Rig Switch's state.\nExternal modification to assigned flag will also affect this button's toggle state!"),
                                                                   linkToggleToRigSwitch);

                if (linkToggleToRigSwitch)
                {
                    CFGUI.BeginIndentedVertical();

                    toggleRigSwitchName = this.toggleRigSwitchInsp.Draw("Switch", toggleRigSwitchName, c.rig, 50);

                    toggleOffWhenHiding = EditorGUILayout.ToggleLeft(new GUIContent("Turn the Switch Off when hiding", "When enabled, this button will turn off linked Rig Switch when hidden."),
                                                                     toggleOffWhenHiding);

                    CFGUI.EndIndentedVertical();
                }



                CFGUI.EndIndentedVertical();
            }

            InspectorUtils.EndIndentedSection();



            InspectorUtils.BeginIndentedSection(new GUIContent("Button Bindings"));


            this.pressBindingInsp.Draw(c.pressBinding, c.rig);
            this.touchPressureBindingInsp.Draw(c.touchPressureBinding, c.rig);

            if (toggle)
            {
                this.toggleBindingInsp.Draw(c.toggleOnlyBinding, c.rig);
            }

            InspectorUtils.EndIndentedSection();


            // Register undo...

            if ((toggle != c.toggle) ||
                (linkToggleToRigSwitch != c.linkToggleToRigSwitch) ||
                (toggleOnAction != c.toggleOnAction) ||
                (toggleOffAction != c.toggleOffAction) ||
                (autoToggleOff != c.autoToggleOff) ||
                (autoToggleOffTimeOut != c.autoToggleOffTimeOut) ||
                (this.emulateTouchPressure != c.emulateTouchPressure) ||
                (toggleOffWhenHiding != c.toggleOffWhenHiding) ||
                (toggleRigSwitchName != c.toggleRigSwitchName))
            {
                CFGUI.CreateUndo("CF2 Button modification", c);

                c.toggle = toggle;
                c.linkToggleToRigSwitch = linkToggleToRigSwitch;
                c.toggleOnAction        = toggleOnAction;
                c.toggleOffAction       = toggleOffAction;
                c.toggleRigSwitchName   = toggleRigSwitchName;
                c.autoToggleOff         = autoToggleOff;
                c.autoToggleOffTimeOut  = autoToggleOffTimeOut;
                c.toggleOffWhenHiding   = toggleOffWhenHiding;
                c.emulateTouchPressure  = this.emulateTouchPressure;


                CFGUI.EndUndo(c);
            }


            // Draw Shared Dynamic Control Params...

            this.DrawDynamicTouchControlGUI(c);
        }
        // -------------------
        static public bool DrawSourceGUI(TouchControlSpriteAnimatorBase target)
        {
            bool
                autoConnect = target.autoConnectToSource;
            TouchControl
                sourceControl = target.sourceControl;


            bool initiallyEnabled = GUI.enabled;

            InspectorUtils.BeginIndentedSection(new GUIContent("Source Control Connection"));

            GUI.enabled = (sourceControl != null);
            if (GUILayout.Button(new GUIContent("Select Source Control"), GUILayout.ExpandWidth(true), GUILayout.Height(20)))
            {
                Selection.activeObject = sourceControl;
                return(false);
            }

            GUI.enabled = initiallyEnabled;

            autoConnect = EditorGUILayout.ToggleLeft(new GUIContent("Auto Connect To Control", "When enabled, this animator will automatically pick source control whenever this gameobject's hierarchy changes."),
                                                     autoConnect, GUILayout.MinWidth(30), GUILayout.ExpandWidth(true));

            if (autoConnect)
            {
                GUI.enabled = false;
            }

            sourceControl = (TouchControl)EditorGUILayout.ObjectField(new GUIContent("Source Control"), sourceControl, target.GetSourceControlType(), true,
                                                                      GUILayout.MaxWidth(30), GUILayout.ExpandWidth(true));

            GUI.enabled = initiallyEnabled;

            if (sourceControl == null)
            {
                InspectorUtils.DrawErrorBox("Source Control is not connected!");
            }
            else if (target.IsIllegallyAttachedToSource())
            {
                InspectorUtils.DrawErrorBox("This Animator is attached to the source control's game object!!\nTransformation Animation will not be possible!!");
            }

            InspectorUtils.EndIndentedSection();


            // Register Undo...

            if ((autoConnect != target.autoConnectToSource) ||
                (sourceControl != target.sourceControl))
            {
                CFGUI.CreateUndo("Sprite Animator Source modification", target);

                target.autoConnectToSource = autoConnect;
                target.SetSourceControl(sourceControl);

                if (target.autoConnectToSource)
                {
                    target.AutoConnectToSource();
                }

                CFGUI.EndUndo(target);
            }

            return(true);
        }
Ejemplo n.º 29
0
        // ---------------
        public override void OnInspectorGUI()
        {
            TouchJoystickSpriteAnimator target = this.target as TouchJoystickSpriteAnimator;

            if ((target == null))
            {
                return;
            }



            if (!TouchControlSpriteAnimatorInspector.DrawSourceGUI(target))
            {
                return;
            }


            TouchJoystickSpriteAnimator.SpriteMode
                spriteMode = target.spriteMode;
            TouchJoystickSpriteAnimator.RotationMode
                rotationMode = target.rotationMode;
            float
                simpleRotationRange      = target.simpleRotationRange,
                rotationSmoothingTime    = target.rotationSmoothingTime,
                translationSmoothingTime = target.translationSmoothingTime;
            Vector2
                moveScale = target.moveScale;
            bool
                animateTransl = target.animateTransl;


            if (target.sourceControl == null)
            {
            }
            else
            {
                InspectorUtils.BeginIndentedSection(new GUIContent("Sprite Settings"));

                spriteMode = (TouchJoystickSpriteAnimator.SpriteMode)EditorGUILayout.EnumPopup(new GUIContent("Sprite Mode", ""),
                                                                                               spriteMode, GUILayout.MinWidth(30), GUILayout.ExpandWidth(true));

                this.spriteNeutral.Draw(target.spriteNeutral, target, true, false);

                EditorGUILayout.Space();                this.spriteNeutralPressed.Draw(target.spriteNeutralPressed, target, target.IsIllegallyAttachedToSource());

                if (spriteMode >= TouchJoystickSpriteAnimator.SpriteMode.FourWay)
                {
                    EditorGUILayout.Space();                this.spriteUp.Draw(target.spriteUp, target, target.IsIllegallyAttachedToSource());

                    if (spriteMode >= TouchJoystickSpriteAnimator.SpriteMode.EightWay)
                    {
                        EditorGUILayout.Space();        this.spriteUpRight.Draw(target.spriteUpRight, target, target.IsIllegallyAttachedToSource());
                    }

                    EditorGUILayout.Space();                this.spriteRight.Draw(target.spriteRight, target, target.IsIllegallyAttachedToSource());

                    if (spriteMode >= TouchJoystickSpriteAnimator.SpriteMode.EightWay)
                    {
                        EditorGUILayout.Space();        this.spriteDownRight.Draw(target.spriteDownRight, target, target.IsIllegallyAttachedToSource());
                    }

                    EditorGUILayout.Space();                this.spriteDown.Draw(target.spriteDown, target, target.IsIllegallyAttachedToSource());

                    if (spriteMode >= TouchJoystickSpriteAnimator.SpriteMode.EightWay)
                    {
                        EditorGUILayout.Space();        this.spriteDownLeft.Draw(target.spriteDownLeft, target, target.IsIllegallyAttachedToSource());
                    }

                    EditorGUILayout.Space();                this.spriteLeft.Draw(target.spriteLeft, target, target.IsIllegallyAttachedToSource());

                    if (spriteMode >= TouchJoystickSpriteAnimator.SpriteMode.EightWay)
                    {
                        EditorGUILayout.Space();        this.spriteUpLeft.Draw(target.spriteUpLeft, target, target.IsIllegallyAttachedToSource());
                    }
                }

                InspectorUtils.EndIndentedSection();
            }


            InspectorUtils.BeginIndentedSection(new GUIContent("Transform Animation Settings"));



            animateTransl = EditorGUILayout.ToggleLeft(new GUIContent("Animate Translation"),
                                                       animateTransl, GUILayout.MinWidth(30), GUILayout.ExpandWidth(true));

            if (animateTransl)
            {
                CFGUI.BeginIndentedVertical();

                moveScale.x = CFGUI.Slider(new GUIContent("X Move. Scale", "Horizontal Movement scale"), moveScale.x, 0, 2, 50);
                moveScale.y = CFGUI.Slider(new GUIContent("Y Move. Scale", "Vertical Movement scale"), moveScale.y, 0, 2, 50);

                translationSmoothingTime = CFGUI.FloatFieldEx(new GUIContent("Smooting Time (ms)", "Translation Smooting Time in milliseconds"),
                                                              translationSmoothingTime, 0, 10, 1000, true, 120);

                CFGUI.EndIndentedVertical();
            }


            EditorGUILayout.Space();

            rotationMode = (TouchJoystickSpriteAnimator.RotationMode)CFGUI.EnumPopup(new GUIContent("Rotation Animation Mode", "How rotation should be animated..."),
                                                                                     rotationMode, 150);

            if (rotationMode != TouchJoystickSpriteAnimator.RotationMode.Disabled)
            {
                CFGUI.BeginIndentedVertical();

                if ((rotationMode == TouchJoystickSpriteAnimator.RotationMode.SimpleHorizontal) ||
                    (rotationMode == TouchJoystickSpriteAnimator.RotationMode.SimpleVertical))
                {
                    simpleRotationRange = CFGUI.Slider(new GUIContent("Rotation Range"),
                                                       simpleRotationRange, -360, 360, 120);
                }

                rotationSmoothingTime = CFGUI.FloatFieldEx(new GUIContent("Smooting Time (ms)", "Rotation Smooting Time in milliseconds"),
                                                           rotationSmoothingTime, 0, 10, 1000, true, 120);

                CFGUI.EndIndentedVertical();
            }

            EditorGUILayout.Space();

//			TouchControlSpriteAnimatorInspector.DrawScaleGUI(target);



            InspectorUtils.EndIndentedSection();



            // Register Undo...

            if ((spriteMode != target.spriteMode) ||
                (simpleRotationRange != target.simpleRotationRange) ||
                (rotationSmoothingTime != target.rotationSmoothingTime) ||
                (translationSmoothingTime != target.translationSmoothingTime) ||
                (rotationMode != target.rotationMode) ||
                (moveScale != target.moveScale) ||
                (animateTransl != target.animateTransl))
            {
                CFGUI.CreateUndo("Joystick Sprite Animator modification", target);



                target.spriteMode               = spriteMode;
                target.simpleRotationRange      = simpleRotationRange;
                target.rotationSmoothingTime    = rotationSmoothingTime;
                target.translationSmoothingTime = translationSmoothingTime;
                target.rotationMode             = rotationMode;
                target.moveScale     = moveScale;
                target.animateTransl = animateTransl;


                CFGUI.EndUndo(target);
            }
        }
Ejemplo n.º 30
0
            // -------------------
            public void DrawConfigGUI(ControlFreak2.SuperTouchZone.MultiFingerTouchConfig config)
            {
                //if (!CFGUI.BoldFoldout(this.configTitleContent, ref this.configFoldedOut))
                //	return;

                InspectorUtils.BeginIndentedSection(this.configTitleContent);

                //CFGUI.BeginIndentedVerticalCFEditorStyles.Inst.boldText);

                bool
                    driveOtherControl = config.driveOtherControl;
                //swipeToDrive		= config.swipeToDrive;
                //useSwipeJoystick	= config.useSwipeJoystick;
                TouchControl
                //controlToDrive				= config.controlToDrive;
                    controlToDriveOnRawPress    = config.controlToDriveOnRawPress,
                    controlToDriveOnNormalPress = config.controlToDriveOnNormalPress,
                    controlToDriveOnLongPress   = config.controlToDriveOnLongPress,

                    controlToDriveOnNormalPressSwipe  = config.controlToDriveOnNormalPressSwipe,
                    controlToDriveOnNormalPressSwipeU = config.controlToDriveOnNormalPressSwipeU,
                    controlToDriveOnNormalPressSwipeR = config.controlToDriveOnNormalPressSwipeR,
                    controlToDriveOnNormalPressSwipeD = config.controlToDriveOnNormalPressSwipeD,
                    controlToDriveOnNormalPressSwipeL = config.controlToDriveOnNormalPressSwipeL,

                    controlToDriveOnLongPressSwipe  = config.controlToDriveOnLongPressSwipe,
                    controlToDriveOnLongPressSwipeU = config.controlToDriveOnLongPressSwipeU,
                    controlToDriveOnLongPressSwipeR = config.controlToDriveOnLongPressSwipeR,
                    controlToDriveOnLongPressSwipeD = config.controlToDriveOnLongPressSwipeD,
                    controlToDriveOnLongPressSwipeL = config.controlToDriveOnLongPressSwipeL;


                //InspectorUtils.BeginIndentedSection(GUIContent.none); //this.configTitleContent);

                //CFGUI.BeginIndentedVertical(CFEditorStyles.Inst.transpSunkenBG);



                this.touchGestureConfigInsp.DrawGUI(config.touchConfig);

                EditorGUILayout.Space();

                //useSwipeJoystick = EditorGUILayout.ToggleLeft(new GUIContent("Use Swipe Joystick", "When enabled, this option gives access to virtual joystick controlled by swiping."),
                //	useSwipeJoystick);

                //if (useSwipeJoystick)
                this.swipeJoyConfigInsp.DrawGUI(config.swipeJoyConfig);

                EditorGUILayout.Space();


                driveOtherControl = EditorGUILayout.ToggleLeft(new GUIContent(" Drive other control", "Use this multi-finger touch to drive other touch control, like joystick or even other touch zone!"),
                                                               driveOtherControl, CFEditorStyles.Inst.boldText);

                if (driveOtherControl)
                {
                    CFGUI.BeginIndentedVertical(CFEditorStyles.Inst.transpSunkenBG);

                    //swipeToDrive = EditorGUILayout.ToggleLeft(new GUIContent("Swipe to drive", "Swipe first to drive other control. This option is useful for joysticks, as it allows to detect many static gestures such as tap without activating the joystick."),
                    //	swipeToDrive);


                    controlToDriveOnRawPress = (TouchControl)CFGUI.ObjectField(new GUIContent("On Raw Press", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                               controlToDriveOnRawPress, typeof(TouchControl), 150);

                    if (controlToDriveOnRawPress == null)
                    {
                        controlToDriveOnNormalPress = (TouchControl)CFGUI.ObjectField(new GUIContent("On Normal Press", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                      controlToDriveOnNormalPress, typeof(TouchControl), 150);

                        if (config.touchConfig.detectLongPress)
                        {
                            controlToDriveOnLongPress = (TouchControl)CFGUI.ObjectField(new GUIContent("On Long Press", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                        controlToDriveOnLongPress, typeof(TouchControl), 150);
                        }

                        controlToDriveOnNormalPressSwipe = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe in Any dir. (Normal Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                           controlToDriveOnNormalPressSwipe, typeof(TouchControl), 150);

                        if (controlToDriveOnNormalPressSwipe == null)
                        {
                            controlToDriveOnNormalPressSwipeU = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Up (Normal Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                controlToDriveOnNormalPressSwipeU, typeof(TouchControl), 150);
                            controlToDriveOnNormalPressSwipeR = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Right (Normal Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                controlToDriveOnNormalPressSwipeR, typeof(TouchControl), 150);
                            controlToDriveOnNormalPressSwipeD = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Down (Normal Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                controlToDriveOnNormalPressSwipeD, typeof(TouchControl), 150);
                            controlToDriveOnNormalPressSwipeL = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Left (Normal Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                controlToDriveOnNormalPressSwipeL, typeof(TouchControl), 150);
                        }

                        if (config.touchConfig.detectLongPress)
                        {
                            controlToDriveOnLongPressSwipe = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe in Any dir. (Long Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                             controlToDriveOnLongPressSwipe, typeof(TouchControl), 120);

                            if (controlToDriveOnLongPressSwipe == null)
                            {
                                controlToDriveOnLongPressSwipeU = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Up (Long Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                  controlToDriveOnLongPressSwipeU, typeof(TouchControl), 120);
                                controlToDriveOnLongPressSwipeR = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Right (Long Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                  controlToDriveOnLongPressSwipeR, typeof(TouchControl), 120);
                                controlToDriveOnLongPressSwipeD = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Down (Long Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                  controlToDriveOnLongPressSwipeD, typeof(TouchControl), 120);
                                controlToDriveOnLongPressSwipeL = (TouchControl)CFGUI.ObjectField(new GUIContent("On Swipe Left (Long Press)", "Touch Control to drive with this multi-finger touch.\n\nTIP: It's a good idea to enable \'Can\'t be touched directly\' option on driven control."),
                                                                                                  controlToDriveOnLongPressSwipeL, typeof(TouchControl), 120);
                            }
                        }
                    }


                    CFGUI.EndIndentedVertical();
                }


                //EditorGUILayout.Space();


                InspectorUtils.EndIndentedSection();


                // Register Undo...


                if ((driveOtherControl != config.driveOtherControl) ||
                    //(swipeToDrive		!= config.swipeToDrive) ||
                    //(controlToDrive		!= config.controlToDrive) )
                    (controlToDriveOnRawPress != config.controlToDriveOnRawPress) ||
                    (controlToDriveOnNormalPress != config.controlToDriveOnNormalPress) ||
                    (controlToDriveOnLongPress != config.controlToDriveOnLongPress) ||

                    (controlToDriveOnNormalPressSwipe != config.controlToDriveOnNormalPressSwipe) ||
                    (controlToDriveOnNormalPressSwipeU != config.controlToDriveOnNormalPressSwipeU) ||
                    (controlToDriveOnNormalPressSwipeR != config.controlToDriveOnNormalPressSwipeR) ||
                    (controlToDriveOnNormalPressSwipeD != config.controlToDriveOnNormalPressSwipeD) ||
                    (controlToDriveOnNormalPressSwipeL != config.controlToDriveOnNormalPressSwipeL) ||

                    (controlToDriveOnLongPressSwipe != config.controlToDriveOnLongPressSwipe) ||
                    (controlToDriveOnLongPressSwipeU != config.controlToDriveOnLongPressSwipeU) ||
                    (controlToDriveOnLongPressSwipeR != config.controlToDriveOnLongPressSwipeR) ||
                    (controlToDriveOnLongPressSwipeD != config.controlToDriveOnLongPressSwipeD) ||
                    (controlToDriveOnLongPressSwipeL != config.controlToDriveOnLongPressSwipeL)
                    )
                //||    (useSwipeJoystick	!= config.useSwipeJoystick))
                {
                    CFGUI.CreateUndo("Multi-finger touch config mod.", this.touchZone);

                    config.driveOtherControl = driveOtherControl;
                    //config.swipeToDrive			= swipeToDrive;
                    //config.controlToDrive		= controlToDrive;
                    //config.useSwipeJoystick		= useSwipeJoystick;
                    config.controlToDriveOnRawPress    = controlToDriveOnRawPress;
                    config.controlToDriveOnNormalPress = controlToDriveOnNormalPress;
                    config.controlToDriveOnLongPress   = controlToDriveOnLongPress;

                    config.controlToDriveOnNormalPressSwipe  = controlToDriveOnNormalPressSwipe;
                    config.controlToDriveOnNormalPressSwipeU = controlToDriveOnNormalPressSwipeU;
                    config.controlToDriveOnNormalPressSwipeR = controlToDriveOnNormalPressSwipeR;
                    config.controlToDriveOnNormalPressSwipeD = controlToDriveOnNormalPressSwipeD;
                    config.controlToDriveOnNormalPressSwipeL = controlToDriveOnNormalPressSwipeL;

                    config.controlToDriveOnLongPressSwipe  = controlToDriveOnLongPressSwipe;
                    config.controlToDriveOnLongPressSwipeU = controlToDriveOnLongPressSwipeU;
                    config.controlToDriveOnLongPressSwipeR = controlToDriveOnLongPressSwipeR;
                    config.controlToDriveOnLongPressSwipeD = controlToDriveOnLongPressSwipeD;
                    config.controlToDriveOnLongPressSwipeL = controlToDriveOnLongPressSwipeL;

                    CFGUI.EndUndo(this.touchZone);
                }
            }