protected virtual void DrawTuningParameters(FTail_AnimatorBase tail) { EditorGUIUtility.labelWidth = 130; EditorGUILayout.BeginVertical(FEditor_Styles.GreenBackground); EditorGUI.indentLevel++; GUILayout.BeginHorizontal(FEditor_Styles.GreenBackground); drawTuningParams = EditorGUILayout.Foldout(drawTuningParams, "Tuning Parameters", true); if (drawAutoFixOption) { GUILayout.FlexibleSpace(); EditorGUIUtility.labelWidth = 80; EditorGUILayout.PropertyField(sp_useAutoCorr, new GUIContent("Automatic", "")); } GUILayout.EndHorizontal(); if (drawTuningParams) { GUILayout.Space(8f); DrawTuningParametersGUI(tail); } EditorGUI.indentLevel--; EditorGUILayout.EndVertical(); EditorGUIUtility.labelWidth = 0; }
protected override void DrawTuningParameters(FTail_AnimatorBase tail) { EditorGUIUtility.labelWidth = 130; EditorGUILayout.BeginVertical(FEditor_Styles.GreenBackground); EditorGUI.indentLevel++; GUILayout.BeginHorizontal(FEditor_Styles.GreenBackground); drawTuningParams = EditorGUILayout.Foldout(drawTuningParams, "Tuning Parameters", true); FTail_AnimatorUI uiTail = tail as FTail_AnimatorUI; if (uiTail) { GUILayout.FlexibleSpace(); EditorGUIUtility.labelWidth = 70; EditorGUILayout.PropertyField(sp_lock); } GUILayout.EndHorizontal(); if (drawTuningParams) { GUILayout.Space(8f); DrawTuningParametersGUI(tail); } EditorGUI.indentLevel--; EditorGUILayout.EndVertical(); GUILayout.Space(1f); EditorGUIUtility.labelWidth = 0; }
protected override void DrawingStack(FTail_AnimatorBase tail) { if (drawDefaultInspector) { GUILayout.Space(5f); DrawDefaultInspector(); } else { serializedObject.Update(); GUILayout.Space(3f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); DrawTailList(tail); DrawSpeedSliders(tail); if (!tail.RootToParent) { DrawWavingOptions((FTail_Animator)tail); } DrawTuningParameters(tail); bool canItPhysics = true; if (tail.RootToParent) { if (tail.TailTransforms.Count == 1) { if (!tail.AutoGetWithOne) { canItPhysics = false; } } } if (canItPhysics) { DrawPhysicalOptionsTab(tail); } EditorGUILayout.EndVertical(); if (drawGizmoSwitcher) { DrawBottomTailBreakLine(); } if (GUI.changed) { tail.OnValidate(); } serializedObject.ApplyModifiedProperties(); } }
public void AddTailToUpdate(FTail_AnimatorBase tail) { if (!tails.Contains(tail)) { if (!tailsQueue.Contains(tail)) { tailsQueue.Add(tail); } } }
protected void DrawBottomTailBreakLine() { if (breakLineTail == null) { breakLineTail = Resources.Load("FTail_BreakLineTail", typeof(Texture2D)) as Texture2D; } Rect rect = GUILayoutUtility.GetRect(128f, breakLineTail.height * 1f); GUILayout.BeginHorizontal(); GUI.DrawTexture(rect, breakLineTail, ScaleMode.StretchToFill, true, 1f); FTail_AnimatorBase tail = (FTail_AnimatorBase)target; tail.drawGizmos = GUILayout.Toggle(tail.drawGizmos, new GUIContent("", "Toggle to switch drawing gizmos")); GUILayout.EndHorizontal(); }
protected virtual void OnClickedAuto() { FTail_AnimatorBase tail = target as FTail_AnimatorBase; if (tail.TailTransforms.Count <= 1) { tail.AutoGetTailTransforms(true); } else { if (tail.TailTransforms[0] == null) { tail.AutoGetTailTransforms(true); } else { bool isnull = false; for (int i = 0; i < tail.TailTransforms.Count; i++) { if (tail.TailTransforms[i] == null) { isnull = true; break; } } if (isnull) { for (int i = 1; i < tail.TailTransforms.Count; i++) { if (tail.TailTransforms[i - 1].childCount == 0) { break; } tail.TailTransforms[i] = tail.TailTransforms[i - 1].GetChild(0); } } else { Transform first = tail.TailTransforms[0]; tail.TailTransforms.Clear(); tail.TailTransforms.Add(first); tail.AutoGetTailTransforms(true); } } } }
protected virtual void DrawSpeedSliders(FTail_AnimatorBase tail) { GUILayout.BeginHorizontal(FEditor_Styles.LBlueBackground); EditorGUILayout.HelpBox("Elasticity Behaviour Parameters", MessageType.None); GUILayout.EndHorizontal(); EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground); EditorGUILayout.Slider(sp_posSpeeds, 0f, 60f); EditorGUILayout.Slider(sp_rotSpeeds, 0f, 60f); EditorGUILayout.EndVertical(); EditorGUILayout.PropertyField(sp_queue); GUILayout.Space(1f); EditorGUIUtility.labelWidth = 0; }
/// <summary> /// Switches few variables for specific behaviour of component /// </summary> private void SwitchConnectWithAnimator(bool turnOn) { FTail_AnimatorBase tailComp = (FTail_AnimatorBase)target; if (turnOn) { wasCorr = tailComp.FullCorrection; wasAnimCorr = tailComp.AnimateCorrections; wasRefresh = tailComp.RefreshHelpers; tailComp.FullCorrection = true; tailComp.AnimateCorrections = true; tailComp.RefreshHelpers = true; } else { tailComp.FullCorrection = wasCorr; tailComp.AnimateCorrections = wasAnimCorr; tailComp.RefreshHelpers = wasRefresh; } }
protected virtual void DrawSpeedSliders(FTail_AnimatorBase tail) { //EditorGUILayout.HelpBox("Elasticity Behaviour Parameters", MessageType.None); string preStr = "►"; if (drawAnimOptions) { preStr = "▼"; } GUILayout.BeginHorizontal(FEditor_Styles.LBlueBackground); if (GUILayout.Button(preStr + " Aniamtion & Elasticity Parameters", EditorStyles.miniLabel)) { drawAnimOptions = !drawAnimOptions; } GUILayout.EndHorizontal(); if (drawAnimOptions) { EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground); //EditorGUILayout.Slider(sp_posSpeeds, 0f, 60f); //EditorGUILayout.Slider(sp_rotSpeeds, 0f, 60f); EditorGUILayout.PropertyField(sp_posSpeeds); EditorGUILayout.PropertyField(sp_rotSpeeds); EditorGUILayout.PropertyField(sp_maxDist); EditorGUILayout.PropertyField(sp_Springiness); EditorGUILayout.EndVertical(); if (!Application.isPlaying) { EditorGUILayout.PropertyField(sp_queue); } GUILayout.Space(1f); EditorGUIUtility.labelWidth = 0; } }
protected override void DrawingStack(FTail_AnimatorBase tail) { if (drawDefaultInspector) { GUILayout.Space(5f); DrawDefaultInspector(); } else { undoManager.CheckUndo(); serializedObject.Update(); GUILayout.Space(3f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); DrawTailList(tail); DrawSpeedSliders(tail); DrawWavingOptions((FTail_Animator)tail); DrawTuningParameters(tail); DrawPhysicalOptionsTab(tail); EditorGUILayout.EndVertical(); if (drawGizmoSwitcher) { DrawBottomTailBreakLine(); } if (GUI.changed) { tail.OnValidate(); } undoManager.CheckDirty(); serializedObject.ApplyModifiedProperties(); } }
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; }
protected virtual void DrawingStack(FTail_AnimatorBase tail) { if (drawDefaultInspector) { GUILayout.Space(5f); DrawDefaultInspector(); } else { serializedObject.Update(); Undo.RecordObject(tail, "TailAnimator Parameters"); GUILayout.Space(3f); EditorGUILayout.BeginVertical(EditorStyles.helpBox); DrawTailList(tail); DrawSpeedSliders(tail); DrawTuningParameters(tail); EditorGUILayout.EndVertical(); if (drawGizmoSwitcher) { DrawBottomTailBreakLine(); } if (GUI.changed) { tail.OnValidate(); } serializedObject.ApplyModifiedProperties(); } }
protected override void DrawSpeedSliders(FTail_AnimatorBase tail) { GUILayout.BeginVertical(FEditor_Styles.LNavy); EditorGUILayout.HelpBox("Elasticity Behaviour Parameters", MessageType.None); EditorGUILayout.Slider(sp_posSpeeds, 0f, 60f); EditorGUILayout.Slider(sp_rotSpeeds, 0f, 60f); GUILayout.EndVertical(); // 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); EditorGUILayout.HelpBox("Use late update order for animated objects", MessageType.Info); GUILayout.EndHorizontal(); EditorGUILayout.PropertyField(sp_upClock, new GUIContent("Update Order")); EditorGUIUtility.labelWidth = 147; EditorGUILayout.PropertyField(sp_discTransf); EditorGUILayout.PropertyField(sp_queue); EditorGUIUtility.labelWidth = 0; EditorGUILayout.EndVertical(); } } GUILayout.Space(1f); EditorGUIUtility.labelWidth = 0; }
protected void DrawAddTailButtons(FTail_AnimatorBase tail) { // V1.2.2 if (GUILayout.Button("Auto", new GUILayoutOption[2] { GUILayout.MaxWidth(48), GUILayout.MaxHeight(14) })) { OnClickedAuto(); } if (GUILayout.Button("+", new GUILayoutOption[2] { GUILayout.MaxWidth(28), GUILayout.MaxHeight(14) })) { if (tail.TailTransforms.Count == 0) { drawTailBones = true; } tail.TailTransforms.Add(null); EditorUtility.SetDirty(target); OnTailTransformsCountChange(); } if (GUILayout.Button("-", new GUILayoutOption[2] { GUILayout.MaxWidth(28), GUILayout.MaxHeight(14) })) { if (tail.TailTransforms.Count > 0) { tail.TailTransforms.RemoveAt(tail.TailTransforms.Count - 1); EditorUtility.SetDirty(target); OnTailTransformsCountChange(); } } }
public override void OnInspectorGUI() { // Update component from last changes serializedObject.Update(); FTail_AnimatorBase tailComp = (FTail_AnimatorBase)target; GUILayout.Space(10f); EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground); EditorGUILayout.BeginHorizontal(); drawDefaultInspector = GUILayout.Toggle(drawDefaultInspector, "Default inspector"); GUILayout.FlexibleSpace(); EditorGUIUtility.labelWidth = 80; drawGizmoSwitcher = GUILayout.Toggle(drawGizmoSwitcher, "View Gizmo Switch"); EditorGUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); DrawingStack(tailComp); // Apply changed parameters variables serializedObject.ApplyModifiedProperties(); }
protected virtual void DrawTuningParameters(FTail_AnimatorBase tail) { EditorGUIUtility.labelWidth = 130; EditorGUILayout.BeginVertical(FEditor_Styles.LBlueBackground); EditorGUI.indentLevel++; GUILayout.BeginHorizontal(FEditor_Styles.LBlueBackground); drawTuningParams = EditorGUILayout.Foldout(drawTuningParams, "Tuning Parameters", true); GUILayout.EndHorizontal(); if (drawTuningParams) { GUILayout.Space(8f); DrawTuningParametersGUI(tail); } EditorGUI.indentLevel--; EditorGUILayout.EndVertical(); EditorGUIUtility.labelWidth = 0; }
protected virtual void DrawTuningParametersGUI(FTail_AnimatorBase tail) { EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_stretch); EditorGUILayout.PropertyField(sp_refr); GUILayout.Space(3f); if (drawAutoFixOption) { EditorGUIUtility.labelWidth = 170; //EditorGUILayout.LabelField(new GUIContent("Full Correction - previously 'Auto go through all bones'")); EditorGUILayout.PropertyField(sp_fullCorrect, new GUIContent(new GUIContent("Full Correction", "If automatic orientation fix should be calculated for each bones separately (previously named 'Auto go through all bones')"))); } if (tail.FullCorrection) { if (!tail.RolledBones) { EditorGUILayout.PropertyField(sp_animate, new GUIContent("Animate Corrections", "When you want corrections to match animation in realtime")); } EditorGUILayout.PropertyField(sp_rollBones, new GUIContent("Rolled Bones?", "Use this option when your model is rolling strangely when waving")); if (tail.UpdateClock != Basics.EFUpdateClock.FixedUpdate) { EditorGUILayout.PropertyField(sp_smoothdelta); } } if (!tail.RolledBones) { EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_axisCorr, new GUIContent("Axis Correction", "[Advanced] Bones wrong rotations axis corrector")); EditorGUILayout.PropertyField(sp_axisBack, new GUIContent("Axis LookBack", "[Advanced] Look rotation transform direction reference")); GUILayout.Space(8f); EditorGUI.indentLevel++; GUILayout.BeginHorizontal(FEditor_Styles.BlueBackground); drawFromTo = EditorGUILayout.Foldout(drawFromTo, new GUIContent("More Advanced Parameters", "Click on toggle to enable using this options"), true); GUILayout.FlexibleSpace(); bool preExtr = tail.ExtraCorrectionOptions; EditorGUILayout.PropertyField(sp_extraCorr, new GUIContent(""), GUILayout.MaxWidth(45f)); if (preExtr != tail.ExtraCorrectionOptions) { if (tail.ExtraCorrectionOptions) { drawFromTo = true; } else { drawFromTo = false; } } GUILayout.EndHorizontal(); EditorGUILayout.BeginVertical(FEditor_Styles.LBlueBackground); if (drawFromTo) { EditorGUIUtility.labelWidth = 117; EditorGUILayout.PropertyField(sp_fromdir, new GUIContent("From Axis", "From rotation transforming. Extra repair parameters for rotating tail in unusual axes space.")); EditorGUILayout.PropertyField(sp_todir, new GUIContent("To Axis", "")); } EditorGUI.indentLevel--; EditorGUILayout.EndVertical(); } EditorGUIUtility.labelWidth = 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; } 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); } GUI.color = preCol; EditorGUILayout.HelpBox("Blending and Animator Help Parameters", MessageType.None); 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_queue); EditorGUIUtility.labelWidth = 0; EditorGUILayout.EndVertical(); GUILayout.Space(4f); }
protected virtual void DrawPhysicalParametersGUI(FTail_AnimatorBase tail) { EditorGUIUtility.labelWidth = 140; if (tail.UseCollision) { EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground); } EditorGUILayout.PropertyField(sp_useCollision); if (!Application.isPlaying) { if (tail.UseCollision) { EditorGUILayout.HelpBox("Collision support is experimental and not working fully correct yet. When entering playmode colliders will be generated as in editor preview", MessageType.Info); EditorGUI.indentLevel++; GUILayout.Space(2f); EditorGUILayout.PropertyField(sp_colType); EditorGUIUtility.labelWidth = 190; EditorGUILayout.PropertyField(sp_colWithOther); EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_colScaleMul, new GUIContent("Scale Multiplier")); EditorGUILayout.PropertyField(sp_colScale, new GUIContent("Scale Curve")); if (tail.CollidersType == FTail_AnimatorBase.FTailColliders.Boxes) { EditorGUILayout.PropertyField(sp_colBoxDim, new GUIContent("Dimensions Mul.")); } EditorGUILayout.PropertyField(sp_colDiffFact, new GUIContent("Auto Curve")); EditorGUILayout.PropertyField(sp_colAddRigs, new GUIContent("Add Rigidbodies", "If you add rigidbodies to each tail segment's collider, collision will work on everything but it will be less optimal, you don't have to add here rigidbodies but then you must have not kinematic rigidbodies on objects segments can collide")); GUILayout.Space(2f); EditorGUI.indentLevel--; } } else { if (tail.UseCollision) { if (!Application.isPlaying) { EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground); } EditorGUI.indentLevel++; GUILayout.Space(2f); EditorGUIUtility.labelWidth = 190; EditorGUILayout.PropertyField(sp_colWithOther); EditorGUIUtility.labelWidth = 140; GUILayout.Space(2f); EditorGUI.indentLevel--; } } if (tail.UseCollision) { GUILayout.Space(2f); EditorGUI.indentLevel++; if (!Application.isPlaying) { EditorGUIUtility.labelWidth = 180; EditorGUILayout.PropertyField(sp_colSameLayer); if (!tail.CollidersSameLayer) { EditorGUI.indentLevel++; EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_colCustomLayer); EditorGUI.indentLevel--; } } EditorGUIUtility.labelWidth = 0; EditorGUILayout.PropertyField(sp_colIgnored, true); EditorGUI.indentLevel--; GUILayout.Space(2f); EditorGUILayout.EndVertical(); } GUILayout.Space(5f); EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_gravity); EditorGUIUtility.labelWidth = 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); }
protected void DrawTailList(FTail_AnimatorBase tail) { GUILayout.BeginHorizontal(FEditor_Styles.BlueBackground); // Long text as tooltip to save space in inspectors EditorGUILayout.LabelField(new GUIContent("ENTER HERE FOR INFO TOOLTIP (no in playmode)", "Put under 'Tail Bones' first bone of tail - component will use children transform to get rest tail bones, or left empty, then tail structure will be created starting from this transform, also you can put here for example 3 bones so only this transforms will be animated")); GUILayout.EndHorizontal(); // Extra info for Tail bones array viewer string extraInfo = ""; bool red = false; if (tail.TailTransforms == null) { tail.TailTransforms = new System.Collections.Generic.List <Transform>(); } if (tail.TailTransforms.Count > 0) { if (tail.TailTransforms[0] == null) { extraInfo = " - NULL BONE!"; red = true; } else if (tail.TailTransforms.Count == 1) { if (tail.AutoGetWithOne) { if (drawTailBones) { extraInfo = " (1 - Auto Get)"; } else { extraInfo = " (1 - Auto Child Transforms)"; } } else { extraInfo = " (Only one bone)"; } } else { bool nullDetected = false; for (int i = 1; i < tail.TailTransforms.Count; i++) { if (tail.TailTransforms[i] == null) { nullDetected = true; break; } } if (nullDetected) { extraInfo = " (SOME NULLS!)"; red = true; } } } else { if (drawTailBones) { extraInfo = " (No Bone - Auto Get)"; } else { extraInfo = " (No Bone - Auto Get)"; } } if (extraInfo == "") { extraInfo = " (" + tail.TailTransforms.Count + ")"; } if (red) { GUILayout.BeginVertical(FEditor_Styles.RedBackground); } else { GUILayout.BeginVertical(FEditor_Styles.GrayBackground); } GUILayout.BeginHorizontal(); EditorGUI.indentLevel++; drawTailBones = EditorGUILayout.Foldout(drawTailBones, "Tail Bones" + extraInfo, true); if (tail.TailTransforms.Count == 1) { EditorGUILayout.PropertyField(sp_autoone, new GUIContent("", "When you want to use auto get when you assigning one bone inside inspector window (Not working with waving - then you have to rotate parent transform in your own way to get same effect)"), new GUILayoutOption[2] { GUILayout.MaxWidth(28), GUILayout.MaxHeight(18) }); } if (drawTailBones) { DrawAddTailButtons(tail); GUILayout.EndHorizontal(); EditorGUI.indentLevel++; for (int i = 0; i < tail.TailTransforms.Count; i++) { tail.TailTransforms[i] = (Transform)EditorGUILayout.ObjectField("Tail Bone [" + i + "]", tail.TailTransforms[i], typeof(Transform), true); } EditorUtility.SetDirty(target); EditorGUI.indentLevel--; } else { if (tail.TailTransforms.Count == 0) { DrawAddTailButtons(tail); } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); GUILayout.BeginVertical(FEditor_Styles.GrayBackground); EditorGUIUtility.labelWidth = 155; EditorGUILayout.PropertyField(sp_rootp); EditorGUIUtility.labelWidth = 0; GUILayout.EndVertical(); if (tail.RootToParent != wasRoot) { if (tail.RootToParent) { tail.LookUpMethod = FTail_AnimatorBase.FELookUpMethod.Parental; foreach (var s in Selection.gameObjects) { if (s == tail.gameObject) { continue; } FTail_Animator b = s.GetComponent <FTail_Animator>(); if (b) { bool enabledIs = false; if (b.RootToParent) { if (b.LookUpMethod == FTail_AnimatorBase.FELookUpMethod.Default) { enabledIs = true; } } if (enabledIs) { b.LookUpMethod = FTail_AnimatorBase.FELookUpMethod.Parental; } } } } } wasRoot = tail.RootToParent; GUILayout.Space(1f); EditorGUI.indentLevel--; EditorGUIUtility.labelWidth = 0; }
protected void DrawAddTailButtons(FTail_AnimatorBase tail) { // V1.2.2 if (GUILayout.Button("Auto", new GUILayoutOption[2] { GUILayout.MaxWidth(48), GUILayout.MaxHeight(14) })) { if (tail.TailTransforms.Count <= 1) { tail.AutoGetTailTransforms(true); } else { if (tail.TailTransforms[0] == null) { tail.AutoGetTailTransforms(true); } else { bool isnull = false; for (int i = 0; i < tail.TailTransforms.Count; i++) { if (tail.TailTransforms[i] == null) { isnull = true; break; } } if (isnull) { for (int i = 1; i < tail.TailTransforms.Count; i++) { if (tail.TailTransforms[i - 1].childCount == 0) { break; } tail.TailTransforms[i] = tail.TailTransforms[i - 1].GetChild(0); } } else { Transform first = tail.TailTransforms[0]; tail.TailTransforms.Clear(); tail.TailTransforms.Add(first); tail.AutoGetTailTransforms(true); } } } } if (GUILayout.Button("+", new GUILayoutOption[2] { GUILayout.MaxWidth(28), GUILayout.MaxHeight(14) })) { if (tail.TailTransforms.Count == 0) { drawTailBones = true; } tail.TailTransforms.Add(null); } if (GUILayout.Button("-", new GUILayoutOption[2] { GUILayout.MaxWidth(28), GUILayout.MaxHeight(14) })) { if (tail.TailTransforms.Count > 0) { tail.TailTransforms.RemoveAt(tail.TailTransforms.Count - 1); } } }
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(); }
protected virtual void DrawTuningParametersGUI(FTail_AnimatorBase tail) { EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_stretch); if (tail.FullCorrection && tail.AnimateCorrections) { EditorGUILayout.PropertyField(sp_refr); } FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.6f)); //if (drawAutoFixOption) { EditorGUIUtility.labelWidth = 170; //EditorGUILayout.LabelField(new GUIContent("Full Correction - previously 'Auto go through all bones'")); EditorGUILayout.PropertyField(sp_fullCorrect, new GUIContent(new GUIContent("Full Correction", "If automatic orientation fix should be calculated for each bones separately (previously named 'Auto go through all bones')"))); } if (tail.FullCorrection) { //if (!tail.RolledBones) EditorGUILayout.PropertyField(sp_animate, new GUIContent("Animate Corrections", "When you want corrections to match animation in realtime")); if (tail.AnimateCorrections) { EditorGUI.indentLevel++; EditorGUILayout.PropertyField(sp_animateRoot); EditorGUI.indentLevel--; } EditorGUILayout.PropertyField(sp_rollBones, new GUIContent("LookUp Method", "Use this option when your model is rolling strangely when waving or other stuff")); if (tail.LookUpMethod == FTail_AnimatorBase.FELookUpMethod.CrossUp) { if (Application.isPlaying) { GUI.enabled = false; } EditorGUIUtility.labelWidth = 190; EditorGUI.indentLevel++; EditorGUILayout.PropertyField(sp_orientRef); EditorGUI.indentLevel--; EditorGUIUtility.labelWidth = 170; if (Application.isPlaying) { GUI.enabled = true; } } } if (tail.UpdateClock != Basics.EFUpdateClock.FixedUpdate) { FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.6f)); EditorGUILayout.PropertyField(sp_smoothdelta); } if (tail.RootToParent) { EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_RootPositionOffset); EditorGUILayout.PropertyField(sp_RootRotationOffset); } FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.6f)); // More Advanced Parameters tab GUILayout.BeginVertical(FEditor_Styles.BlueBackground); GUILayout.BeginHorizontal(); drawExtraParameters = EditorGUILayout.Foldout(drawExtraParameters, new GUIContent("Advanced Parameters"), true); if (drawAutoFixOption) { if (!Application.isPlaying) { GUILayout.FlexibleSpace(); EditorGUIUtility.labelWidth = 80; EditorGUILayout.PropertyField(sp_useAutoCorr, new GUIContent("Automatic", "")); } } GUILayout.EndHorizontal(); if (drawExtraParameters) { if (tail.LookUpMethod == FTail_AnimatorBase.FELookUpMethod.Default) { EditorGUIUtility.labelWidth = 135; if (!tail.FullCorrection) { EditorGUILayout.PropertyField(sp_axisCorr, new GUIContent("Axis Correction", "[Advanced] Bones wrong rotations axis corrector")); } EditorGUILayout.PropertyField(sp_axisBack, new GUIContent("Axis LookBack", "[Advanced] Look rotation transform direction reference")); EditorGUIUtility.labelWidth = 0; } GUILayout.Space(6f); GUILayout.BeginVertical(FEditor_Styles.LGrayBackground); GUILayout.BeginHorizontal(); drawFromTo = EditorGUILayout.Foldout(drawFromTo, new GUIContent("Additional FromTo", "Click on toggle to enable using this option"), true); GUILayout.FlexibleSpace(); bool preExtr = tail.ExtraCorrectionOptions; EditorGUILayout.PropertyField(sp_extraCorr, new GUIContent(""), GUILayout.MaxWidth(45f)); if (preExtr != tail.ExtraCorrectionOptions) { if (tail.ExtraCorrectionOptions) { drawFromTo = true; } else { drawFromTo = false; } } GUILayout.EndHorizontal(); if (drawFromTo) { if (!tail.FullCorrection) { EditorGUIUtility.labelWidth = 117; EditorGUILayout.PropertyField(sp_fromdir, new GUIContent("From Axis", "From rotation transforming. Extra repair parameters for rotating tail in unusual axes space.")); EditorGUILayout.PropertyField(sp_todir, new GUIContent("To Axis", "")); } else { EditorGUILayout.PropertyField(sp_todir, new GUIContent("To Axis", "")); } } GUILayout.EndVertical(); GUILayout.EndVertical(); DrawInAdvTweaking(); //EditorGUI.indentLevel--; } else { GUILayout.EndVertical(); } EditorGUIUtility.labelWidth = 0; }
protected virtual void DrawPhysicalParametersGUI(FTail_AnimatorBase tail) { EditorGUIUtility.labelWidth = 140; if (tail.UseCollision) { EditorGUILayout.BeginVertical(FEditor_Styles.GrayBackground); } EditorGUILayout.PropertyField(sp_useCollision); if (!Application.isPlaying) { if (tail.UseCollision) { EditorGUILayout.PropertyField(sp_CollisionSpace); if (tail.CollisionSpace == FTail_AnimatorBase.ECollisionSpace.World_Slow) { EditorGUILayout.HelpBox("Collision support is experimental and not working fully correct yet. When entering playmode colliders will be generated as in editor preview", MessageType.None); EditorGUILayout.HelpBox("Tail should have assigned layer which is not colliding with itself", MessageType.Info); FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.6f)); EditorGUILayout.PropertyField(sp_CollisionMethod); } else { EditorGUILayout.HelpBox("Collision support is experimental and not working fully correct yet.", MessageType.Info); } if (tail.CollisionSpace == FTail_AnimatorBase.ECollisionSpace.World_Slow) { EditorGUI.indentLevel++; GUILayout.Space(2f); EditorGUIUtility.labelWidth = 190; EditorGUILayout.PropertyField(sp_colWithOther); EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_colAddRigs, new GUIContent("Add Rigidbodies", "If you add rigidbodies to each tail segment's collider, collision will work on everything but it will be less optimal, you don't have to add here rigidbodies but then you must have not kinematic rigidbodies on objects segments can collide")); if (tail.CollidersAddRigidbody) { EditorGUI.indentLevel++; EditorGUIUtility.labelWidth = 152; EditorGUILayout.PropertyField(sp_RigidbodyMass); EditorGUI.indentLevel--; } GUILayout.Space(4f); EditorGUIUtility.labelWidth = 180; EditorGUILayout.PropertyField(sp_colSameLayer); if (!tail.CollidersSameLayer) { EditorGUI.indentLevel++; EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_colCustomLayer); EditorGUI.indentLevel--; } EditorGUIUtility.labelWidth = 0; EditorGUILayout.PropertyField(sp_colIgnored, true); EditorGUI.indentLevel--; } else { EditorGUILayout.BeginVertical(FEditor_Styles.Emerald); Color c = GUI.color; GUILayout.BeginVertical(); if (ActiveEditorTracker.sharedTracker.isLocked) { GUI.color = new Color(0.44f, 0.44f, 0.44f, 0.8f); } else { GUI.color = new Color(0.95f, 0.95f, 0.99f, 0.9f); } if (GUILayout.Button(new GUIContent("Lock Inspector for Drag & Drop Colliders", "Drag & drop colliders to 'Included Colliders' List from the hierarchy"), EditorStyles.toolbarButton)) { ActiveEditorTracker.sharedTracker.isLocked = !ActiveEditorTracker.sharedTracker.isLocked; } GUI.color = c; GUILayout.EndVertical(); EditorGUILayout.PropertyField(sp_IncludedColliders, true); EditorGUILayout.EndVertical(); // EditorGUI.indentLevel--; } FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.6f)); if (tail.CollisionMethod == FTail_AnimatorBase.ECollisionMethod.RotationOffset_Old) { EditorGUILayout.HelpBox("'RotationOffset method required bigger collider size than it's mesh", MessageType.None); } EditorGUILayout.PropertyField(sp_colScaleMul, new GUIContent("Scale Multiplier")); EditorGUILayout.PropertyField(sp_colScale, new GUIContent("Scale Curve")); EditorGUILayout.PropertyField(sp_colDiffFact, new GUIContent("Auto Curve")); } } else // In Playmode { if (tail.UseCollision) { if (tail.CollisionSpace == FTail_AnimatorBase.ECollisionSpace.World_Slow) { EditorGUILayout.PropertyField(sp_CollisionMethod); FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.6f)); EditorGUI.indentLevel++; EditorGUIUtility.labelWidth = 190; EditorGUILayout.PropertyField(sp_colWithOther); GUILayout.Space(4f); EditorGUIUtility.labelWidth = 0; //EditorGUILayout.PropertyField(sp_colIgnored, true); EditorGUI.indentLevel--; GUILayout.Space(3f); } else { EditorGUILayout.BeginVertical(FEditor_Styles.Emerald); Color c = GUI.color; GUILayout.BeginVertical(); if (ActiveEditorTracker.sharedTracker.isLocked) { GUI.color = new Color(0.44f, 0.44f, 0.44f, 0.8f); } else { GUI.color = new Color(0.95f, 0.95f, 0.99f, 0.9f); } if (GUILayout.Button(new GUIContent("Lock Inspector for Drag & Drop Colliders", "Drag & drop colliders to 'Included Colliders' List from the hierarchy"), EditorStyles.toolbarButton)) { ActiveEditorTracker.sharedTracker.isLocked = !ActiveEditorTracker.sharedTracker.isLocked; } GUI.color = c; GUILayout.EndVertical(); EditorGUILayout.PropertyField(sp_IncludedColliders, true); EditorGUILayout.EndVertical(); // EditorGUI.indentLevel--; EditorGUILayout.HelpBox("Rescalling in playmode available only in editor not in build", MessageType.Warning); EditorGUILayout.PropertyField(sp_colScaleMul, new GUIContent("Scale Multiplier")); EditorGUILayout.PropertyField(sp_colScale, new GUIContent("Scale Curve")); EditorGUILayout.PropertyField(sp_colDiffFact, new GUIContent("Auto Curve")); GUILayout.Space(3f); } } } if (tail.UseCollision) { FEditor_Styles.DrawUILine(new Color(0.5f, 0.5f, 0.5f, 0.6f)); //if (tail.LookUpMethod == FTail_AnimatorBase.FELookUpMethod.Parental && tail.FullCorrection) //{ // GUI.enabled = false; // tail.CollisionSwapping = 0.5f; EditorGUILayout.HelpBox("Swapping is not available with 'Parental' correction algorithm", MessageType.None); //} EditorGUILayout.PropertyField(sp_CollisionSwapping); GUILayout.Space(3f); if (GUI.enabled == false) { GUI.enabled = true; } if (tail.CollisionSpace == FTail_AnimatorBase.ECollisionSpace.Selective_Fast) { EditorGUILayout.PropertyField(sp_DetailedCollision); GUILayout.Space(3f); } EditorGUILayout.EndVertical(); } GUILayout.Space(5f); EditorGUIUtility.labelWidth = 140; EditorGUILayout.PropertyField(sp_curving); EditorGUILayout.PropertyField(sp_gravity); EditorGUILayout.PropertyField(sp_StiffTailEnd); //EditorGUILayout.PropertyField(sp_GravAlong); EditorGUIUtility.labelWidth = 0; }