コード例 #1
0
        private void Tab_DrawShaping()
        {
            FGUI_Inspector.VSpace(-2, -4);
            GUILayout.BeginVertical(FGUI_Resources.ViewBoxStyle);
            GUILayout.BeginVertical(FGUI_Resources.BGInBoxBlankStyle);

            GUILayout.Space(2f);
            EditorGUIUtility.labelWidth = 120;

            if (FEngineering.QIsZero(Get.RotationOffset))
            {
                GUI.color = defaultValC;
            }
            else
            {
                GUI.color = c;
            }

            EditorGUI.BeginChangeCheck();
            Get.RotationOffset = Quaternion.Euler(EditorGUILayout.Vector3Field(new GUIContent(sp_tailRotOff.displayName, sp_tailRotOff.tooltip), FEngineering.WrapVector(Get.RotationOffset.eulerAngles)));
            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
                GetSelectedTailAnimators();
                for (int i = 0; i < lastSelected.Count; i++)
                {
                    lastSelected[i].RotationOffset = Get.RotationOffset; new SerializedObject(lastSelected[i]).ApplyModifiedProperties();
                }
            }

            // Curving Tail
            GUILayout.Space(2f);
            if (FEngineering.QIsZero(Get.Curving) && !Get.UseCurlingCurve)
            {
                GUI.color = defaultValC;
            }
            else
            {
                GUI.color = c;
            }

            EditorGUILayout.BeginHorizontal();

            EditorGUI.BeginChangeCheck();
            Get.Curving = Quaternion.Euler(EditorGUILayout.Vector3Field(new GUIContent(sp_curving.displayName, sp_curving.tooltip), FEngineering.WrapVector(Get.Curving.eulerAngles)));
            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
                GetSelectedTailAnimators();
                for (int i = 0; i < lastSelected.Count; i++)
                {
                    lastSelected[i].Curving = Get.Curving; new SerializedObject(lastSelected[i]).ApplyModifiedProperties();
                }
            }

            if (Get.UseCurvingCurve)
            {
                EditorGUILayout.LabelField(new GUIContent("*", "Curving offset value weight for tail segments multiplied by curve"), GUILayout.Width(9));
                EditorGUILayout.PropertyField(sp_CurvCurve, new GUIContent("", sp_curving.tooltip), GUILayout.MaxWidth(32));
            }
            else
            {
                GUILayout.Space(4f);
            }

            EditorGUI.BeginChangeCheck();
            SwitchButton(ref Get.UseCurvingCurve, "Spread curving rotation offset weight over tail segments", curveIcon);
            if (EditorGUI.EndChangeCheck())
            {
                GetSelectedTailAnimators(); for (int i = 0; i < lastSelected.Count; i++)
                {
                    lastSelected[i].UseCurvingCurve = Get.UseCurvingCurve; new SerializedObject(lastSelected[i]).ApplyModifiedProperties();
                }
            }
            EditorGUILayout.EndHorizontal();

            GUILayout.Space(3f);

            // Length Stretch
            if (Get.LengthMultiplier == 1f && !Get.UseLengthMulCurve)
            {
                GUI.color = defaultValC;
            }
            else
            {
                GUI.color = c;
            }

            EditorGUILayout.BeginHorizontal();

            if (!Get.UseLengthMulCurve)
            {
                EditorGUILayout.PropertyField(sp_LengthMultiplier);
                GUILayout.Space(4f); EditorGUI.BeginChangeCheck();
                SwitchButton(ref Get.UseLengthMulCurve, "Spread length multiplier weight over tail segments", curveIcon);
                if (EditorGUI.EndChangeCheck())
                {
                    GetSelectedTailAnimators(); for (int i = 0; i < lastSelected.Count; i++)
                    {
                        lastSelected[i].UseLengthMulCurve = Get.UseLengthMulCurve; new SerializedObject(lastSelected[i]).ApplyModifiedProperties();
                    }
                }
            }
            else
            {
                EditorGUILayout.PropertyField(sp_LengthMulCurve, new GUIContent(sp_LengthMultiplier.displayName, sp_LengthMultiplier.tooltip));
                GUILayout.Space(4f); EditorGUI.BeginChangeCheck();
                SwitchButton(ref Get.UseLengthMulCurve, "Spread length multiplier weight over tail segments", curveIcon);
                if (EditorGUI.EndChangeCheck())
                {
                    GetSelectedTailAnimators(); for (int i = 0; i < lastSelected.Count; i++)
                    {
                        lastSelected[i].UseLengthMulCurve = Get.UseLengthMulCurve; new SerializedObject(lastSelected[i]).ApplyModifiedProperties();
                    }
                }
            }

            EditorGUILayout.EndHorizontal();

            EditorGUIUtility.labelWidth = 0;
            GUILayout.EndVertical();
            GUILayout.EndVertical();
        }