private void TryNowEditingAPuppet(GameObject active)
        {
            var selectedPuppet = active.GetComponent <ComboGesturePuppet>();

            if (selectedPuppet != null && selectedPuppet != _editorEffector.GetPuppet())
            {
                WindowHandler.RetargetPuppet(selectedPuppet);
                Repaint();
            }
        }
        private void LayoutBlendTreeAssetCreator()
        {
            if (_editorEffector.GetCurrentlyEditing() == CurrentlyEditing.Puppet && _editorEffector.GetPuppet().mainTree != null)
            {
                return;
            }

            EditorGUILayout.Separator();
            EditorGUILayout.LabelField(CgeLocale.CGEE_Create_a_new_blend_tree, EditorStyles.boldLabel);
            _blendTreeEffector.CurrentTemplate = (PuppetTemplate)EditorGUILayout.EnumPopup("Template", _blendTreeEffector.CurrentTemplate);
            switch (_blendTreeEffector.CurrentTemplate)
            {
            case PuppetTemplate.FourDirections:
                EditorGUILayout.HelpBox(CgeLocale.CGEE_ExplainFourDirections, MessageType.Info);
                break;

            case PuppetTemplate.EightDirections:
                EditorGUILayout.HelpBox(CgeLocale.CGEE_ExplainEightDirections, MessageType.Info);
                break;

            case PuppetTemplate.SixDirectionsPointingForward:
                EditorGUILayout.HelpBox(CgeLocale.CGEE_ExplainSixDirectionsPointingForward, MessageType.Info);
                break;

            case PuppetTemplate.SixDirectionsPointingSideways:
                EditorGUILayout.HelpBox(CgeLocale.CGEE_ExplainSixDirectionsPointingSideways, MessageType.Info);
                break;

            case PuppetTemplate.SingleAnalogFistWithHairTrigger:
                EditorGUILayout.HelpBox(CgeLocale.CGEE_ExplainSingleAnalogFistWithHairTrigger, MessageType.Info);
                break;

            case PuppetTemplate.SingleAnalogFistAndTwoDirections:
                EditorGUILayout.HelpBox(CgeLocale.CGEE_ExplainSingleAnalogFistAndTwoDirections, MessageType.Info);
                break;

            case PuppetTemplate.DualAnalogFist:
                EditorGUILayout.HelpBox(CgeLocale.CGEE_ExplainDualAnalogFist, MessageType.Info);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            var isFistRelated = _blendTreeEffector.CurrentTemplate == PuppetTemplate.SingleAnalogFistWithHairTrigger ||
                                _blendTreeEffector.CurrentTemplate == PuppetTemplate.SingleAnalogFistAndTwoDirections ||
                                _blendTreeEffector.CurrentTemplate == PuppetTemplate.DualAnalogFist;

            _blendTreeEffector.MiddleClip = (AnimationClip)EditorGUILayout.ObjectField(
                isFistRelated ? CgeLocale.CGEE_TreeAnimationAtRest : CgeLocale.CGEE_TreeJoystickCenterAnimation, _blendTreeEffector.MiddleClip, typeof(AnimationClip), false);
            if (!isFistRelated)
            {
                _blendTreeEffector.CenterSafety = EditorGUILayout.Toggle(CgeLocale.CGEE_TreeFixJoystickSnapping, _blendTreeEffector.CenterSafety);
                _blendTreeEffector.Maximum      = EditorGUILayout.Slider(CgeLocale.CGEE_TreeJoystickMaximumTilt, _blendTreeEffector.Maximum, 0.1f, 1.0f);
            }

            if (GUILayout.Button(CgeLocale.CGEE_TreeCreateAsset))
            {
                var createdTree = MaybeCreateNewBlendTreeAsset();
                if (createdTree != null)
                {
                    if (_editorEffector.GetCurrentlyEditing() == CurrentlyEditing.Puppet)
                    {
                        _editorEffector.GetPuppet().mainTree = createdTree;
                    }
                    else
                    {
                        _blendTreeEffector.BlendTreeBeingEdited = createdTree;
                        _editorEffector.SwitchAdditionalEditorTo(AdditionalEditorsMode.ViewBlendTrees);
                    }
                }
            }
        }