예제 #1
0
        protected virtual void DrawPhysicalOptionsTab(FTail_AnimatorBase tail)
        {
            EditorGUIUtility.labelWidth = 130;

            EditorGUILayout.BeginVertical(FEditor_Styles.Style(new Color(0.9f, 0.5f, 0.2f, 0.15f)));

            EditorGUI.indentLevel++;

            GUILayout.BeginHorizontal(FEditor_Styles.LGrayBackground);
            drawPhysicalParams = EditorGUILayout.Foldout(drawPhysicalParams, "Physical & Experimental", true);
            GUILayout.EndHorizontal();

            if (drawPhysicalParams)
            {
                GUILayout.Space(8f);
                DrawPhysicalParametersGUI(tail);
            }

            EditorGUI.indentLevel--;
            EditorGUILayout.EndVertical();

            EditorGUIUtility.labelWidth = 0;
        }
예제 #2
0
    protected virtual void DrawPhysicalOptionsTab(FSpineAnimator spine)
    {
        EditorGUIUtility.labelWidth = 130;

        EditorGUILayout.BeginVertical(FEditor_Styles.Style(new Color(0.9f, 0.9f, 0.9f, 0.15f)));

        EditorGUI.indentLevel++;

        GUILayout.BeginHorizontal(FEditor_Styles.LGrayBackground);
        drawCollisionParams = EditorGUILayout.Foldout(drawCollisionParams, "Collisions (Experimental)", true);
        GUILayout.EndHorizontal();

        if (drawCollisionParams)
        {
            GUILayout.Space(3f);
            DrawPhysicsStuff(spine);
        }

        EditorGUI.indentLevel--;
        EditorGUILayout.EndVertical();

        EditorGUIUtility.labelWidth = 0;
    }
예제 #3
0
        protected override void DrawSpeedSliders(FTail_AnimatorBase tail)
        {
            base.DrawSpeedSliders(tail);

            EditorGUILayout.BeginVertical(FEditor_Styles.GreenBackground);

            bool connected = false;

            if (!Application.isPlaying)
            {
                if (tail.FullCorrection && tail.AnimateCorrections && tail.RefreshHelpers)
                {
                    connected = true;
                }
            }
            else
            if (tail.FullCorrection && tail.AnimateCorrections)
            {
                connected = true;
            }

            string preStr = "►";

            if (drawAnimatorOptions)
            {
                preStr = "▼";
            }
            GUILayout.BeginHorizontal(FEditor_Styles.Style(new Color32(255, 225, 255, 35)));
            if (GUILayout.Button(preStr + " Blending and Animator Help Parameters", EditorStyles.miniLabel))
            {
                drawAnimatorOptions = !drawAnimatorOptions;
            }
            GUILayout.EndHorizontal();

            if (drawAnimatorOptions)
            {
                Color preCol = GUI.color;
                if (connected)
                {
                    GUI.color = new Color(0.1f, 1f, 0.325f, 0.9f);
                }

                if (GUILayout.Button(new GUIContent("Connect with animator", "This button changing some variables to make component cooperate highly with animator's animation. VARIABLES WHICH ARE CHANGED: RefreshHelpers, FullCorrection, AnimateCorrection"), new GUILayoutOption[1] {
                    GUILayout.MaxHeight(18)
                }))
                {
                    SwitchConnectWithAnimator(!connected);

                    foreach (var s in Selection.gameObjects)
                    {
                        if (s == tail.gameObject)
                        {
                            continue;
                        }
                        FTail_AnimatorBlending b = s.GetComponent <FTail_AnimatorBlending>();
                        if (b)
                        {
                            bool enabledIs = false;
                            if (b.FullCorrection && b.AnimateCorrections)
                            {
                                enabledIs = true;
                            }

                            if (!enabledIs)
                            {
                                b.FullCorrection     = true;
                                b.AnimateCorrections = true;
                                b.RefreshHelpers     = true;
                            }
                            else
                            {
                                b.FullCorrection     = false;
                                b.AnimateCorrections = false;
                            }
                        }
                    }
                }

                GUI.color = preCol;

                FTail_AnimatorBlending tailBlending = (FTail_AnimatorBlending)target;
                EditorGUILayout.Slider(sp_blendOrig, 0f, 1f);

                if (tailBlending.BlendToOriginal > 0f && tailBlending.BlendToOriginal < 1f)
                {
                    if (tailBlending.TailTransforms.Count > 0)
                    {
                        float height = 16f;
                        Rect  rect   = GUILayoutUtility.GetRect(GUILayoutUtility.GetLastRect().width, height, "TextField");

                        float step = rect.width / (float)tailBlending.TailTransforms.Count;

                        for (int i = 0; i < tailBlending.TailTransforms.Count; i++)
                        {
                            float y = 1 - Mathf.InverseLerp(tailBlending.TailTransforms.Count / 2, tailBlending.TailTransforms.Count + 1, i);

                            float blendValue = 1f;

                            if (tailBlending.BlendChainValue < 1f)
                            {
                                blendValue = Mathf.Clamp(tailBlending.BlendChainValue * (float)tailBlending.TailTransforms.Count - i, 0f, 1f);
                            }

                            EditorGUI.DrawRect(new Rect(rect.x + 2 + i * step, rect.y + (1 - y) * ((height - 1) / 2), step - 2f, height * y), new Color(0.9f, 0.9f, 0.9f, blendValue * 0.78f));
                        }

                        var centered = GUI.skin.GetStyle("Label");
                        centered.alignment = TextAnchor.UpperCenter;
                        GUI.Label(rect, Mathf.Round(tailBlending.BlendChainValue * 100) + "% Source Animation Chain Blend", centered);
                    }

                    EditorGUILayout.Slider(sp_blendChain, 0f, 1f);
                }
                else
                {
                    GUILayout.BeginHorizontal();
                    EditorGUILayout.HelpBox("Blend with original for chain blend", MessageType.None);
                    GUILayout.EndHorizontal();
                }

                EditorGUIUtility.labelWidth = 147;
                EditorGUILayout.PropertyField(sp_posNotAnim);
                EditorGUILayout.PropertyField(sp_rotNotAnim);
                EditorGUIUtility.labelWidth = 0;

                if (tailBlending.RotationsNotAnimated)
                {
                    if (tailBlending.SelectiveRotsNotAnimated.Count == 0)
                    {
                        EditorGUILayout.HelpBox("Hit 'Auto' for this option to work", MessageType.Info);
                    }
                    else
                    {
                        EditorGUI.indentLevel++;
                        EditorGUILayout.PropertyField(sp_rotsSelective, true);
                        EditorGUI.indentLevel--;
                    }
                }

                GUILayout.Space(4f);

                EditorGUIUtility.labelWidth = 147;
                EditorGUILayout.PropertyField(sp_queue);
                EditorGUIUtility.labelWidth = 0;
            }

            EditorGUILayout.EndVertical();
            GUILayout.Space(4f);
        }
예제 #4
0
        protected virtual void DrawWavingOptions(FTail_Animator tail)
        {
            EditorGUI.indentLevel++;

            EditorGUILayout.BeginVertical(FEditor_Styles.Style(new Color(0.5f, 0.2f, 0.9f, 0.1f)));

            GUILayout.BeginHorizontal(FEditor_Styles.LBlueBackground);
            drawWavingParams = EditorGUILayout.Foldout(drawWavingParams, "Waving Options", true);

            GUILayout.FlexibleSpace();
            EditorGUIUtility.labelWidth = 90;

            if (!tail.RootToParent)
            {
                EditorGUILayout.PropertyField(sp_useWav);
            }

            GUILayout.EndHorizontal();

            if (!tail.RootToParent)
            {
                if (drawWavingParams)
                {
                    EditorGUIUtility.labelWidth = 165;

                    EditorGUILayout.PropertyField(sp_wavType);

                    if (tail.WavingType == FTail_Animator.FEWavingType.Simple)
                    {
                        GUILayout.Space(5f);
                        EditorGUILayout.PropertyField(sp_cosAd);
                        GUILayout.Space(5f);
                    }
                    else
                    {
                        GUILayout.Space(5f);
                        EditorGUILayout.PropertyField(sp_altWave);
                        GUILayout.Space(5f);
                    }

                    EditorGUILayout.PropertyField(sp_wavSp);
                    EditorGUILayout.PropertyField(sp_wavRa);
                    GUILayout.Space(5f);


                    Color preCol = GUI.color;

                    if (tail.WavingType == FTail_Animator.FEWavingType.Advanced)
                    {
                        if (tail.WavingAxis.x == 0f || tail.WavingAxis.y == 0f || tail.WavingAxis.z == 0f)
                        {
                            EditorGUILayout.HelpBox("With advanced waving, try use all axes", MessageType.None);
                            GUI.color = new Color(1f, 1f, 0.8f, 0.95f);
                        }
                    }

                    EditorGUILayout.PropertyField(sp_wavAx);

                    GUI.color = preCol;


                    EditorGUILayout.PropertyField(sp_tailRotOff);
                }
            }

            EditorGUI.indentLevel--;
            EditorGUILayout.EndVertical();

            EditorGUIUtility.labelWidth = 0;
        }
예제 #5
0
        protected override void DrawSpeedSliders(FTail_AnimatorBase tail)
        {
            GUILayout.BeginVertical(FEditor_Styles.LNavy);
            //EditorGUILayout.HelpBox("Elasticity Behaviour Parameters", MessageType.None);

            string preStr = "►";

            if (drawAnimOptions)
            {
                preStr = "▼";
            }
            GUILayout.BeginHorizontal(FEditor_Styles.Style(new Color32(255, 225, 255, 35)));
            //GUILayout.BeginHorizontal(FEditor_Styles.Style(new Color(0.8f,0.8f,0.8f, 0.45f) ));
            if (GUILayout.Button(preStr + " Animation & Elasticity Parameters", EditorStyles.miniLabel))
            {
                drawAnimOptions = !drawAnimOptions;
            }
            GUILayout.EndHorizontal();

            if (drawAnimOptions)
            {
                Color preCol = GUI.color;

                GUIStyle smallStyle = new GUIStyle(EditorStyles.miniLabel)
                {
                    fontStyle = FontStyle.Italic
                };
                GUI.color = new Color(1f, 1f, 1f, 0.7f);


                EditorGUILayout.BeginVertical();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Label("                                       Smooth", smallStyle);
                GUILayout.FlexibleSpace();
                GUILayout.Label("Rapid                  ", smallStyle);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(-8f);

                EditorGUIUtility.labelWidth = 115;
                GUI.color = preCol;
                //GUI.color = new Color(0.93f, 1f, 0.93f, 0.9f);
                EditorGUILayout.PropertyField(sp_posSpeeds);

                EditorGUILayout.PropertyField(sp_rotSpeeds);

                GUILayout.Space(2f);
                EditorGUILayout.EndVertical();


                FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.25f));
                //GUILayout.Space(6f);


                //if ( tail.UseCollision ) if ( tail.LookUpMethod == FTail_AnimatorBase.FELookUpMethod.Parental ) if (tail.Springiness > 0.1f) GUI.color = new Color(0.95f, 0.85f, 0.8f, 0.9f);

                GUI.color = new Color(1f, 1f, 1f, 0.7f);
                EditorGUILayout.BeginVertical();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Label("                                       Calm", smallStyle);
                GUILayout.FlexibleSpace();
                GUILayout.Label("Bouncy                  ", smallStyle);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(-8f);
                GUI.color = preCol;
                EditorGUILayout.PropertyField(sp_Springiness);
                GUI.color = new Color(1f, 1f, 1f, 0.7f);
                EditorGUILayout.EndVertical();

                EditorGUILayout.BeginVertical();

                EditorGUILayout.BeginHorizontal();
                GUILayout.Label("                                       Stiff", smallStyle);
                GUILayout.FlexibleSpace();
                GUILayout.Label("Wavy                  ", smallStyle);
                EditorGUILayout.EndHorizontal();
                GUI.color = preCol;
                GUILayout.Space(-8f);
                EditorGUILayout.EndVertical();

                if (tail.UseCollision)
                {
                    if (tail.LookUpMethod == FTail_AnimatorBase.FELookUpMethod.Parental)
                    {
                        if (tail.Sensitivity < 0.485f || tail.Sensitivity > 0.75f)
                        {
                            GUI.color = new Color(0.95f, 0.85f, 0.8f, 0.9f);
                        }
                    }
                }
                EditorGUILayout.PropertyField(sp_Sensitivity);
                GUI.color = preCol;

                FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.25f));

                if ((tail.Springiness > 0.5f && tail.MaxStretching > 0.3f))
                {
                    GUI.color = new Color(0.8f, 1f, 0.8f, 0.9f);
                }
                else
                if ((tail.AngleLimit < 90 && tail.MaxStretching > 0.2f))
                {
                    GUI.color = new Color(1f, 0.8f, 0.8f, 0.9f);
                }

                EditorGUILayout.PropertyField(sp_maxDist);
                GUI.color = preCol;
                //if (tail.AngleLimit >= 180) GUI.color = preCol * new Color(1f, 1f, 1f, 0.6f);
                EditorGUILayout.PropertyField(sp_AngleLimit);
                if (tail.AngleLimit < 90)
                {
                    //EditorGUI.indentLevel++;
                    if (tail.AngleLimitAxis == Vector3.zero)
                    {
                        GUI.color = preCol * new Color(1f, 1f, 1f, 0.6f);
                    }
                    EditorGUILayout.PropertyField(sp_AngleLimitAxis);
                    GUI.color = preCol;

                    if (tail.AngleLimitAxis != Vector3.zero)
                    {
                        if (tail.LimitAxisRange.x == tail.LimitAxisRange.y)
                        {
                            GUI.color = preCol * new Color(1f, 1f, 1f, 0.6f);
                        }
                        EditorGUILayout.MinMaxSlider(new GUIContent("Range", "If you want limit axes symmetrically leave this parameter unchanged, if you want limit one direction of axis more than reversed, tweak this parameter"),
                                                     ref tail.LimitAxisRange.x, ref tail.LimitAxisRange.y, -90f, 90f);
                        //EditorGUILayout.PropertyField(sp_AngleLimitAxisTo);
                        GUI.color = preCol;
                    }

                    EditorGUILayout.PropertyField(sp_LimitSmoothing);

                    //EditorGUI.indentLevel--;
                }

                GUI.color = preCol;

                EditorGUILayout.PropertyField(sp_MotionInfluence);

                EditorGUIUtility.labelWidth = 0;
                GUILayout.Space(5f);

                // V1.2
                FTail_Animator         tailSimple   = tail as FTail_Animator;
                FTail_AnimatorBlending tailBlending = tail as FTail_AnimatorBlending;
                if (!tailBlending)
                {
                    if (tailSimple != null)
                    {
                        EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground);

                        //GUILayout.BeginHorizontal(FEditor_Styles.LBlueBackground);
                        //if (!Application.isPlaying)
                        //    EditorGUILayout.HelpBox("Use late update order for animated objects", MessageType.Info);
                        //else
                        //EditorGUILayout.HelpBox("  Use late update order for animated objects", MessageType.None);

                        //GUILayout.EndHorizontal();
                        GUILayout.BeginHorizontal(FEditor_Styles.LBlueBackground);

                        EditorGUIUtility.labelWidth = 97;
                        EditorGUILayout.PropertyField(sp_upClock, new GUIContent("Update Order"));
                        EditorGUIUtility.labelWidth = 0;

                        if (!Application.isPlaying)
                        {
                            if (tail.UpdateClock != EFUpdateClock.LateUpdate)
                            {
                                GUILayout.FlexibleSpace();
                                GUI.color = new Color(1f, 1f, 1f, 0.7f);
                                float width = (float)typeof(EditorGUIUtility).GetProperty("contextWidth", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).GetValue(null, null);

                                if (width > 375)
                                {
                                    GUILayout.Label(new GUIContent("Use LateUpdate for animated objects", "Use LateUpdate order for animated objects (animated by unity Animator or Animation components) or use FTail_AnimatorBlending component instead of FTail_Animator"), smallStyle);
                                }
                                else if (width > 310)
                                {
                                    GUILayout.Label(new GUIContent("Use LateUpdate for...", "Use LateUpdate order for animated objects (animated by unity Animator or Animation components) or use FTail_AnimatorBlending component instead of FTail_Animator"), smallStyle);
                                }
                                else
                                {
                                    GUILayout.Label(new GUIContent("Put Cursor Here", "(Tooltip) Use LateUpdate order for animated objects (animated by unity Animator or Animation components) or use FTail_AnimatorBlending component instead of FTail_Animator"), smallStyle);
                                }

                                GUI.color = preCol;
                            }
                        }

                        GUILayout.EndHorizontal();

                        if (!Application.isPlaying)
                        {
                            EditorGUIUtility.labelWidth = 147;
                            EditorGUILayout.PropertyField(sp_queue);
                        }
                        EditorGUIUtility.labelWidth = 0;

                        EditorGUILayout.EndVertical();
                    }
                }

                GUILayout.Space(1f);

                EditorGUIUtility.labelWidth = 0;
            }

            GUILayout.EndVertical();
        }
예제 #6
0
    void DrawOldGUI()
    {
        GUILayout.Space(5f);
        Color preCol = GUI.color;

        EditorGUILayout.BeginVertical(FEditor_Styles.Style(FColorMethods.ChangeColorAlpha(Color.white, 0.25f)));
        EditorGUI.indentLevel++;

        drawMain = EditorGUILayout.Foldout(drawMain, "Main Parameters", true);


        #region Main Tab

        if (drawMain)
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            if (Get.SpineBones == null || Get.SpineBones.Count < 1)
            {
                GUILayout.BeginHorizontal(FEditor_Styles.YellowBackground);
                EditorGUILayout.HelpBox("Put here two marginal bones from hierarchy and click 'Get' to create spine chain of section you want to animate with spine animator", MessageType.Info);
                GUILayout.EndHorizontal();
            }

            EditorGUILayout.BeginVertical(FEditor_Styles.LGrayBackground);

            if (Get.SpineBones == null || Get.SpineBones.Count < 1)
            {
                GUIStyle smallStyle = new GUIStyle(EditorStyles.miniLabel)
                {
                    fontStyle = FontStyle.Italic, fontSize = 9
                };
                GUI.color = new Color(1f, 1f, 1f, 0.7f);
                EditorGUILayout.BeginHorizontal();
                GUILayout.Label(new GUIContent("             Enter for tooltip", "If you rigging quadroped or other animal, start bone should be pelvis bone with back legs and tail inside the hierarchy"), smallStyle);
                GUILayout.FlexibleSpace();
                GUILayout.Label(new GUIContent("Enter for tooltip                       ", "If you rigging quadroped or other animal, end bone should be chest bone / neck bone or head bone, depends of your needs and model structure"), smallStyle);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(1f);
            }

            EditorGUILayout.BeginHorizontal();
            int wrong = 0;
            if (Get.SpineBones != null)
            {
                if (Get.SpineBones.Count < 2)
                {
                    wrong = 2;
                }
                else
                {
                    if (startBone != Get.SpineBones[0].transform || endBone != Get.SpineBones[Get.SpineBones.Count - 1].transform)
                    {
                        wrong = 3;
                    }
                }
            }
            else
            {
                wrong = 1;
            }

            if (wrong == 1)
            {
                GUI.color = new Color(1f, 0.3f, 0.3f, 0.85f);
            }
            if (wrong == 2)
            {
                GUI.color = new Color(1f, 0.7f, 0.2f, 0.85f);
            }

            EditorGUI.indentLevel--;

            EditorGUIUtility.labelWidth = 42f;
            startBone = Get._gizmosEditorStartPreview;
            endBone   = Get._gizmosEditorEndPreview;
            if (startBone == null)
            {
                TryFindStartBone();
            }
            if (endBone == null)
            {
                TryFindEndBone();
            }

            startBone = (Transform)EditorGUILayout.ObjectField(new GUIContent("Start", "Put here first bone in hierarchy depth for automatically get chain of bones to end one"), startBone, typeof(Transform), true);
            endBone   = (Transform)EditorGUILayout.ObjectField(new GUIContent("End", "Put here last bone in hierarchy depth for automatically get chain of bones from start one"), endBone, typeof(Transform), true);

            EditorGUIUtility.labelWidth = 0f;

            if (GUILayout.Button(new GUIContent("L", "Automatically get last bone in hierarchy - it depends of children placement, then sometimes last bone can be found wrong, whne you have arms/legs bones inside, if they're higher, algorithm will go through them"), new GUILayoutOption[2] {
                GUILayout.MaxWidth(24), GUILayout.MaxHeight(14)
            }))
            {
                GetLastBoneInHierarchy();
            }

            if (wrong == 3)
            {
                GUI.color = new Color(0.2f, 1f, 0.4f, 0.85f);
            }
            if (startBone != null && endBone != null)
            {
                GUI.color = new Color(0.3f, 1f, 0.4f, 0.8f);

                if (Get.SpineBones != null)
                {
                    if (Get.SpineBones.Count > 0)
                    {
                        if (startBone != Get.SpineBones[0].transform || endBone != Get.SpineBones[Get.SpineBones.Count - 1].transform)
                        {
                            wrong = 3;
                        }
                        else
                        {
                            GUI.color = FColorMethods.ChangeColorAlpha(preCol, 0.7f);
                        }
                    }
                }
            }

            if (GUILayout.Button(new GUIContent("Get"), new GUILayoutOption[2] {
                GUILayout.MaxWidth(36), GUILayout.MaxHeight(14)
            }))
            {
                Get.CreateSpineChain(Get._gizmosEditorStartPreview, Get._gizmosEditorEndPreview);
                //GetBonesChainFromStartToEnd();
                //Get.TryAutoCorrect(null, false);
                EditorUtility.SetDirty(target);
            }


            GUI.color = preCol;

            EditorGUILayout.EndHorizontal();


            if (Get.SpineBones == null || Get.SpineBones.Count < 1)
            {
                GUIStyle smallStyle = new GUIStyle(EditorStyles.miniLabel)
                {
                    fontStyle = FontStyle.Italic, fontSize = 9
                };
                GUI.color = new Color(1f, 1f, 1f, 0.7f);
                EditorGUILayout.BeginHorizontal();
                GUILayout.Label(new GUIContent("        Pelvis bone with Legs", "If you rigging quadroped or other animal, start bone should be pelvis bone with back legs and tail inside the hierarchy"), smallStyle);
                GUILayout.FlexibleSpace();
                GUILayout.Label(new GUIContent("Chest/Neck/Head bone             ", "If you rigging quadroped or other animal, end bone should be chest bone / neck bone or head bone, depends of your needs and model structure"), smallStyle);
                EditorGUILayout.EndHorizontal();
                GUILayout.Space(1f);
            }


            EditorGUILayout.EndVertical();
            EditorGUI.indentLevel++;

            if (Get.SpineBones == null || Get.SpineBones.Count < 1)
            {
                EditorGUILayout.EndVertical();
                EditorGUILayout.EndVertical();
                return;
            }

            EditorGUIUtility.labelWidth = 148f;
            EditorGUILayout.PropertyField(sp_forw);
            EditorGUIUtility.labelWidth = 0;

            if (Get.SpineBones.Count < 1)
            {
                EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground);
            }
            //EditorGUILayout.BeginHorizontal(FEditor_Styles.Style(new Color32(99, 50, 166, 45)));
            else
            {
                EditorGUILayout.BeginVertical(FEditor_Styles.LGrayBackground);
            }
            //EditorGUILayout.BeginHorizontal(FEditor_Styles.Style(new Color32(10, 66, 175, 25)));

            //EditorGUILayout.PropertyField(sp_spines, true);

            drawSpineTransforms = EditorGUILayout.Foldout(drawSpineTransforms, new GUIContent("Spine Transforms", "Spine chain transforms"), true, new GUIStyle(EditorStyles.foldout)
            {
                fontStyle = FontStyle.Bold
            });

            if (drawSpineTransforms)
            {
                EditorGUIUtility.labelWidth = 120;
                for (int i = 0; i < Get.SpineBones.Count; i++)
                {
                    EditorGUILayout.BeginHorizontal();

                    GUI.enabled = false;
                    EditorGUILayout.ObjectField("Spine Bone [" + i + "]", Get.SpineBones[i].transform, typeof(Transform), true);
                    if (i != 0 && i != Get.SpineBones.Count - 1)
                    {
                        GUI.enabled = true;
                    }

                    if (GUILayout.Button("X", new GUILayoutOption[2] {
                        GUILayout.Width(20), GUILayout.Height(14)
                    }))
                    {
                        Get.SpineBones.RemoveAt(i);
                        EditorUtility.SetDirty(target);
                        break;
                    }

                    GUI.enabled = true;
                    EditorGUILayout.EndHorizontal();
                }
                EditorGUIUtility.labelWidth = 0;
            }

            EditorGUILayout.EndVertical();

            EditorGUIUtility.labelWidth = 124f;
            EditorGUI.indentLevel--;

            EditorGUILayout.BeginVertical(FEditor_Styles.Style(new Color32(0, 200, 100, 22)));
            EditorGUILayout.BeginVertical(FEditor_Styles.Style(new Color32(0, 200, 100, 0)));
            GUILayout.Space(2f);
            EditorGUILayout.PropertyField(sp_SpineAnimatorAmount, true);
            GUILayout.Space(3f);

            EditorGUIUtility.labelWidth = 128f;

            GUI.color = new Color(0.3f, 1f, 0.4f, 0.8f);
            EditorGUILayout.PropertyField(sp_LastBoneLeading, true);
            GUI.color = preCol;

            GUILayout.Space(2f);

            //bool animatorDetected = CheckForAnimator(Get);
            //if (!animatorDetected && Get.SyncWithAnimator) GUI.color = new Color(1f, 0.2f, 0.2f, 0.8f);
            //else if (animatorDetected && Get.SyncWithAnimator == false) GUI.color = new Color(1f, 1f, 0.35f, 0.8f);

            //EditorGUIUtility.labelWidth = 163f;
            //EditorGUILayout.PropertyField(sp_SyncWithAnimator, true);
            GUI.color = preCol;

            GUILayout.Space(2f);
            EditorGUILayout.EndVertical();
            EditorGUILayout.EndVertical();
            GUILayout.Space(2f);

            EditorGUIUtility.labelWidth = 0f;

            EditorGUILayout.EndVertical();
            EditorGUI.indentLevel++;
        }

        #endregion

        #region Animation Options

        EditorGUILayout.BeginVertical(FEditor_Styles.LGrayBackground);
        drawAnimationOptions = EditorGUILayout.Foldout(drawAnimationOptions, "Animation Options", true);

        if (drawAnimationOptions)
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            EditorGUI.indentLevel--;
            GUI.color = new Color(0.55f, 0.75f, 0.9f, 0.85f);

            GUILayout.BeginVertical(FEditor_Styles.Style(new Color32(33, 130, 200, 24)));

            EditorGUIUtility.labelWidth = 105f;
            GUILayout.Space(4f);

            Color preCc = GUI.color;

            if (Get.UseCollisions)
            {
                if (Get.UseTruePosition)
                {
                    if (Get.PosSmoother < 0.075f)
                    {
                        GUI.color = new Color(0.9f, 0.5f, 0.5f);
                    }
                    else if (Get.PosSmoother < 0.225f)
                    {
                        GUI.color = Color.Lerp(new Color(0.9f, 0.6f, 0.6f), preCc, Mathf.InverseLerp(0.075f, 0.225f, Get.PosSmoother));
                    }
                }
            }

            EditorGUILayout.PropertyField(sp_PositionsSmoother, true);
            GUI.color = preCc;

            EditorGUILayout.PropertyField(sp_RotationsSmoother, true);
            if (Get.PosSmoother > 0.1f || Get.Springiness > 0f)
            {
                EditorGUILayout.PropertyField(sp_MaxStretching, true);
            }
            GUILayout.Space(5f);

            EditorGUILayout.EndVertical();

            GUILayout.BeginVertical(FEditor_Styles.Style(new Color32(33, 130, 230, 58)));

            EditorGUILayout.PropertyField(sp_AngleLimit, true);
            EditorGUILayout.PropertyField(sp_LimitingAngleSmoother, true);

            EditorGUILayout.EndVertical();

            GUILayout.BeginVertical(FEditor_Styles.Style(new Color32(33, 130, 230, 58)));

            EditorGUIUtility.labelWidth = 120f;
            EditorGUILayout.PropertyField(sp_StraighteningSpeed, true);
            EditorGUIUtility.labelWidth = 0f;

            if (Get.StraightenSpeed > 0f)
            {
                EditorGUI.indentLevel++;
                EditorGUIUtility.labelWidth = 121f;
                EditorGUILayout.PropertyField(sp_TurboStraighten, true);
                EditorGUI.indentLevel--;
                GUILayout.Space(3f);
                EditorGUIUtility.labelWidth = 105f;
            }

            EditorGUILayout.EndVertical();

            GUILayout.BeginVertical(FEditor_Styles.LBlueBackground);

            EditorGUIUtility.labelWidth = 105f;

            if (!Get.LastBoneLeading)
            {
                if (Get.Springiness > 0)
                {
                    if (Get.GoBackSpeed <= 0)
                    {
                        GUI.color = new Color(0.55f, 0.9f, 1f, 1f);
                    }
                }
            }
            EditorGUILayout.PropertyField(sp_GoBackSpeed, true);
            EditorGUILayout.PropertyField(sp_Slithery, true);

            GUI.color = new Color(0.55f, 0.75f, 0.9f, 0.85f);


            if (!Get.LastBoneLeading)
            {
                if (Get.Springiness <= 0)
                {
                    if (Get.GoBackSpeed > 0.15f)
                    {
                        GUI.color = new Color(0.55f, 0.9f, 1f, 0.95f);
                    }
                }

                EditorGUILayout.PropertyField(sp_Springiness, true);
            }


            EditorGUILayout.EndVertical();

            EditorGUIUtility.labelWidth = 0f;
            EditorGUILayout.EndVertical();
            GUILayout.Space(5f);
            EditorGUI.indentLevel++;

            GUI.color = preCol;
        }

        EditorGUILayout.EndVertical();

        #endregion

        #region Basic Correction

        EditorGUILayout.BeginVertical(FEditor_Styles.LGrayBackground);

        EditorGUILayout.BeginHorizontal();
        drawQuickCorrection = EditorGUILayout.Foldout(drawQuickCorrection, "Main Tuning Options", true);

        GUI.color = preCol;

        EditorGUILayout.EndHorizontal();

        if (drawPreciseAutoCorr)
        {
            EditorGUILayout.BeginHorizontal();

            EditorGUI.indentLevel--;
            EditorGUIUtility.labelWidth = 74f;

            if (!headBone)
            {
                GUI.color = new Color(0.9f, 0.3f, 0.3f, 0.9f);
            }
            headBone  = (Transform)EditorGUILayout.ObjectField(new GUIContent("Head bone", "Head bone or some bone before, it's important to be in front of spine and not included in spine animator's chain"), headBone, typeof(Transform), true);
            GUI.color = preCol;

            EditorGUI.indentLevel++;
            EditorGUIUtility.labelWidth = 0f;

            EditorGUILayout.EndHorizontal();
        }

        if (drawQuickCorrection)
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);
            GUILayout.Space(3f);

            EditorGUIUtility.labelWidth = 146f;

            if (!Application.isPlaying)
            {
                EditorGUILayout.PropertyField(sp_StartAfterTPose, true);
            }

            GUILayout.Space(3f);
            EditorGUILayout.PropertyField(sp_MainPivotOffset, true);

            EditorGUIUtility.labelWidth = 0f;
            GUILayout.Space(5f);

            EditorGUILayout.EndVertical();
        }

        EditorGUILayout.EndVertical();

        #endregion

        #region Advanced correction

        EditorGUILayout.BeginVertical(FEditor_Styles.LGrayBackground);
        drawAdvancedCorrection = EditorGUILayout.Foldout(drawAdvancedCorrection, "Advanced Options", true);

        if (drawAdvancedCorrection)
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            GUILayout.Space(4f);
            EditorGUIUtility.labelWidth = 144f;
            if (!Application.isPlaying)
            {
                EditorGUILayout.PropertyField(sp_PhysicalClock, true);
            }
            EditorGUILayout.PropertyField(sp_DeltaType);

            EditorGUIUtility.labelWidth = 166f;

            if (Get.AnchorRoot && !Get.UpdateAsLast)
            {
                GUI.color = new Color(0.5f, 1f, 0.65f, 0.85f);
            }

            if (!Application.isPlaying)
            {
                EditorGUILayout.PropertyField(sp_UpdateAsLast, true);
            }
            GUI.color = preCol;

            FEditor_Styles.DrawUILine(new Color(0.6f, 0.6f, 0.6f, 0.4f));

            GUILayout.BeginVertical(FEditor_Styles.Style(new Color32(33, 200, 130, 24)));
            EditorGUILayout.PropertyField(sp_LeadBoneRotationOffset, true);

            serializedObject.ApplyModifiedProperties();

            GUILayout.EndVertical();

            GUILayout.Space(4f);

            FEditor_Styles.DrawUILine(new Color(0.6f, 0.6f, 0.6f, 0.4f));

            EditorGUILayout.PropertyField(sp_SegmentsPivotOffset, true);
            EditorGUILayout.PropertyField(sp_DistancesMul, true);

            FEditor_Styles.DrawUILine(new Color(0.6f, 0.6f, 0.6f, 0.4f));

            GUILayout.Space(3f);
            EditorGUI.indentLevel++;

            EditorGUILayout.PropertyField(sp_ManualAffects, true);
            GUILayout.Space(5f);
            EditorGUI.indentLevel--;

            EditorGUIUtility.labelWidth = 0f;
            EditorGUILayout.EndVertical();
        }

        EditorGUILayout.EndVertical();

        #endregion


        #region Debug Options

        EditorGUILayout.BeginVertical(FEditor_Styles.LGrayBackground);
        drawDebug = EditorGUILayout.Foldout(drawDebug, "Debugging", true);

        if (drawDebug)
        {
            EditorGUILayout.BeginVertical(EditorStyles.helpBox);

            GUILayout.BeginHorizontal(FEditor_Styles.LBlueBackground);
            EditorGUILayout.HelpBox("When 'DrawDebug' is toggled, you can use button '~' to instantly deactivate SpineAnimator's motion for time you hold this button (not on build)", MessageType.None);
            GUILayout.EndHorizontal();

            GUILayout.Space(5f);
            GUILayout.Space(5f);

            EditorGUIUtility.labelWidth = 0f;
            EditorGUILayout.EndVertical();
        }

        EditorGUILayout.EndVertical();

        #endregion


        EditorGUILayout.EndVertical();
        EditorGUI.indentLevel--;

        DrawPhysicalOptionsTab(Get);
    }