//abstract protected GUIContent GetTitle();



        // --------------------
        public void Init(TouchControlPanel panel, System.Action onCreationCallback)
        {
            this.panel = panel;
            this.onCreationCallback = onCreationCallback;

            this.emulateTouchPressure = true;

            this.canvas = (Canvas)CFUtils.GetComponentHereOrInParent(this.panel, typeof(Canvas));

            this.controlName = "NewControl";

            this.dynamicMode  = ControlMode.Static;
            this.regionRect   = RegionRectPreset.LeftHalf;
            this.controlShape = TouchControl.Shape.Circle;

            this.staticAnchor = ControlAnchorPoint.BottomRight;
            this.controlSize  = 0.15f;

            this.controlDepth = Mathf.Lerp(DEPTH_MIN, DEPTH_MAX, 0.25f);
            this.regionDepth  = Mathf.Lerp(DEPTH_MIN, DEPTH_MAX, 0.70f);

            // Restore params...

            if (mStoredParamsSaved)
            {
                this.controlSize  = mStoredControlSize;
                this.staticAnchor = mStoredStaticAnchor;
                this.controlDepth = mStoredControlDepth;
                this.regionDepth  = mStoredRegionDepth;
                this.controlShape = mStoredControlShape;
            }
        }
 // -----------------
 private void StoreParameters()
 {
     mStoredParamsSaved  = true;
     mStoredControlSize  = this.controlSize;
     mStoredStaticAnchor = this.staticAnchor;
     mStoredRegionDepth  = this.regionDepth;
     mStoredControlDepth = this.controlDepth;
     mStoredControlShape = this.controlShape;
 }
        // -------------------
        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();
        }
        // -------------------
        public void DrawTouchContolGUI(TouchControl c)
        {
            if (c == null)
            {
                return;
            }

            bool
                ignoreFingerRadius       = c.ignoreFingerRadius,
                cantBeControlledDirectly = c.cantBeControlledDirectly,
                shareTouch = c.shareTouch,
                dontAcceptSharedTouches = c.dontAcceptSharedTouches,
                canBeSwipedOver         = c.canBeSwipedOver,
                restictSwipeOverTargets = c.restictSwipeOverTargets;

            TouchControl.SwipeOverOthersMode
                swipeOverOthersMode = c.swipeOverOthersMode;
            TouchControl.SwipeOffMode
                swipeOffMode = c.swipeOffMode;
            TouchControl.Shape
                shape = c.shape;


            // GUI...

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

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

            ignoreFingerRadius = EditorGUILayout.ToggleLeft(new GUIContent("Ignore finger radius", "When enabled, this can only be hit by finger's center - finger's radius defined in Touch Control Panel will be ignored when hit testing."),
                                                            ignoreFingerRadius, GUILayout.MinWidth(30));

            cantBeControlledDirectly = EditorGUILayout.ToggleLeft(new GUIContent("Can't be touched directly", "When enabled, this control will not respond to direct touches, only to touches passed by it's dynamic region or other controls."),
                                                                  cantBeControlledDirectly, GUILayout.MinWidth(30));
            shareTouch = EditorGUILayout.ToggleLeft(new GUIContent("Touch-Through", "When touched, this control will pass it's controling touch down to control other controls below (if they accept shared touches)."),
                                                    shareTouch, GUILayout.MinWidth(30));
            dontAcceptSharedTouches = EditorGUILayout.ToggleLeft(new GUIContent("Don't accept shared touches", "When enabled, this control will not respond to touches already controlling other controls."),
                                                                 dontAcceptSharedTouches, GUILayout.MinWidth(30));

            EditorGUILayout.Space();

            canBeSwipedOver = EditorGUILayout.ToggleLeft(new GUIContent("Can be swiped over", "This control can be touched by swiping over it."),
                                                         canBeSwipedOver, GUILayout.MinWidth(30));

            swipeOffMode = (TouchControl.SwipeOffMode)CFGUI.EnumPopup(new GUIContent("Swipe Off", "Release when finger swipes off this control?"),
                                                                      swipeOffMode, 100);

            swipeOverOthersMode = (TouchControl.SwipeOverOthersMode)CFGUI.EnumPopup(new GUIContent("Swipe Over Others", "When to allow swiping over other controls?"),
                                                                                    swipeOverOthersMode, 100);



            if (swipeOverOthersMode != TouchControl.SwipeOverOthersMode.Disabled)
            {
                restictSwipeOverTargets = EditorGUILayout.ToggleLeft(new GUIContent("Restrict Swipe Over Targets", "Choose specific controls that can be swiped over from this control..."),
                                                                     restictSwipeOverTargets, GUILayout.MinWidth(30));

                if (restictSwipeOverTargets)
                {
                    this.swipeOverTargetListInsp.DrawGUI();
                }
            }


            InspectorUtils.EndIndentedSection();



            // Hiding conditions section...

            this.disablingConditionSetInsp.DrawGUI();



            // Refister undo...

            if (
                (ignoreFingerRadius != c.ignoreFingerRadius) ||
                (cantBeControlledDirectly != c.cantBeControlledDirectly) ||
                (shareTouch != c.shareTouch) ||
                (shareTouch != c.shareTouch) ||
                (dontAcceptSharedTouches != c.dontAcceptSharedTouches) ||

                (canBeSwipedOver != c.canBeSwipedOver) ||
                (swipeOffMode != c.swipeOffMode) ||
                (swipeOverOthersMode != c.swipeOverOthersMode) ||
                (restictSwipeOverTargets != c.restictSwipeOverTargets) ||

                (shape != c.shape))
            {
                CFGUI.CreateUndo("Touch Control Base Param modification", c);

                c.ignoreFingerRadius       = ignoreFingerRadius;
                c.cantBeControlledDirectly = cantBeControlledDirectly;
                c.shareTouch = shareTouch;
                c.dontAcceptSharedTouches = dontAcceptSharedTouches;
                c.shape = shape;

                c.canBeSwipedOver         = canBeSwipedOver;
                c.swipeOffMode            = swipeOffMode;
                c.swipeOverOthersMode     = swipeOverOthersMode;
                c.restictSwipeOverTargets = restictSwipeOverTargets;


                CFGUI.EndUndo(c);
            }
        }