GenerateMecanimAnimationClips() публичный статический Метод

public static GenerateMecanimAnimationClips ( SkeletonDataAsset skeletonDataAsset ) : void
skeletonDataAsset SkeletonDataAsset
Результат void
 void DrawUnityTools()
 {
                 #if SPINE_SKELETON_ANIMATOR
     using (new SpineInspectorUtility.BoxScope()) {
         isMecanimExpanded = EditorGUILayout.Foldout(isMecanimExpanded, SpineInspectorUtility.TempContent("SkeletonAnimator", SpineInspectorUtility.UnityIcon <SceneAsset>()));
         if (isMecanimExpanded)
         {
             EditorGUI.indentLevel++;
             EditorGUILayout.PropertyField(controller, SpineInspectorUtility.TempContent("Controller", SpineInspectorUtility.UnityIcon <Animator>()));
             if (controller.objectReferenceValue == null)
             {
                 // Generate Mecanim Controller Button
                 using (new GUILayout.HorizontalScope()) {
                     GUILayout.Space(EditorGUIUtility.labelWidth);
                     if (GUILayout.Button(SpineInspectorUtility.TempContent("Generate Mecanim Controller"), GUILayout.Height(20)))
                     {
                         SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
                     }
                 }
                 EditorGUILayout.HelpBox("SkeletonAnimator is the Mecanim alternative to SkeletonAnimation.\nIt is not required.", MessageType.Info);
             }
             else
             {
                 // Update AnimationClips button.
                 using (new GUILayout.HorizontalScope()) {
                     GUILayout.Space(EditorGUIUtility.labelWidth);
                     if (GUILayout.Button(SpineInspectorUtility.TempContent("Force Update AnimationClips"), GUILayout.Height(20)))
                     {
                         SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
                     }
                 }
             }
             EditorGUI.indentLevel--;
         }
     }
                 #endif
 }
        void DrawUnityTools()
        {
                        #if SPINE_SKELETON_ANIMATOR
            using (new SpineInspectorUtility.BoxScope()) {
                isMecanimExpanded = EditorGUILayout.Foldout(isMecanimExpanded, new GUIContent("SkeletonAnimator", Icons.unityIcon));
                if (isMecanimExpanded)
                {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.PropertyField(controller, new GUIContent("Controller", Icons.controllerIcon));
                    if (controller.objectReferenceValue == null)
                    {
                        // Generate Mecanim Controller Button
                        using (new GUILayout.HorizontalScope()) {
                            GUILayout.Space(EditorGUIUtility.labelWidth);
                            if (GUILayout.Button(new GUIContent("Generate Mecanim Controller"), GUILayout.Height(20)))
                            {
                                SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
                            }
                        }
                        EditorGUILayout.HelpBox("SkeletonAnimator is the Mecanim alternative to SkeletonAnimation.\nIt is not required.", MessageType.Info);
                    }
                    else
                    {
                        // Update AnimationClips button.
                        using (new GUILayout.HorizontalScope()) {
                            GUILayout.Space(EditorGUIUtility.labelWidth);
                            if (GUILayout.Button(new GUIContent("Force Update AnimationClips"), GUILayout.Height(20)))
                            {
                                SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
                            }
                        }
                    }
                    EditorGUI.indentLevel--;
                }
            }
                        #endif

                        #if SPINE_BAKING
            bool pre = isBakingExpanded;
            isBakingExpanded = EditorGUILayout.Foldout(isBakingExpanded, new GUIContent("Baking", Icons.unityIcon));
            if (pre != isBakingExpanded)
            {
                EditorPrefs.SetBool(ShowBakingPrefsKey, isBakingExpanded);
            }

            if (isBakingExpanded)
            {
                EditorGUI.indentLevel++;
                const string BakingWarningMessage =
//					"WARNING!" +
//					"\nBaking is NOT the same as SkeletonAnimator!" +
//					"\n\n" +
                    "The main use of Baking is to export Spine projects to be used without the Spine Runtime (ie: for sale on the Asset Store, or background objects that are animated only with a wind noise generator)" +

                    "\n\nBaking does not support the following:" +
                    "\n\tDisabled transform inheritance" +
                    "\n\tShear" +
                    "\n\tColor Keys" +
                    "\n\tDraw Order Keys" +
                    "\n\tAll Constraint types" +

                    "\n\nCurves are sampled at 60fps and are not realtime." +
                    "\nPlease read SkeletonBaker.cs comments for full details.";
                EditorGUILayout.HelpBox(BakingWarningMessage, MessageType.Info, true);

                EditorGUI.indentLevel++;
                bakeAnimations = EditorGUILayout.Toggle("Bake Animations", bakeAnimations);
                using (new EditorGUI.DisabledGroupScope(!bakeAnimations)) {
                    EditorGUI.indentLevel++;
                    bakeIK           = EditorGUILayout.Toggle("Bake IK", bakeIK);
                    bakeEventOptions = (SendMessageOptions)EditorGUILayout.EnumPopup("Event Options", bakeEventOptions);
                    EditorGUI.indentLevel--;
                }

                // Bake Skin buttons.
                using (new GUILayout.HorizontalScope()) {
                    if (GUILayout.Button(new GUIContent("Bake All Skins", Icons.unityIcon), GUILayout.Height(32), GUILayout.Width(150)))
                    {
                        SkeletonBaker.BakeToPrefab(m_skeletonDataAsset, m_skeletonData.Skins, "", bakeAnimations, bakeIK, bakeEventOptions);
                    }

                    if (m_skeletonAnimation != null && m_skeletonAnimation.skeleton != null)
                    {
                        Skin bakeSkin = m_skeletonAnimation.skeleton.Skin;

                        string skinName = "<No Skin>";
                        if (bakeSkin == null)
                        {
                            skinName = "Default";
                            bakeSkin = m_skeletonData.Skins.Items[0];
                        }
                        else
                        {
                            skinName = m_skeletonAnimation.skeleton.Skin.Name;
                        }

                        using (new GUILayout.VerticalScope()) {
                            if (GUILayout.Button(new GUIContent("Bake \"" + skinName + "\"", Icons.unityIcon), GUILayout.Height(32), GUILayout.Width(250)))
                            {
                                SkeletonBaker.BakeToPrefab(m_skeletonDataAsset, new ExposedList <Skin>(new [] { bakeSkin }), "", bakeAnimations, bakeIK, bakeEventOptions);
                            }
                            using (new GUILayout.HorizontalScope()) {
                                GUILayout.Label(new GUIContent("Skins", Icons.skinsRoot), GUILayout.Width(50));
                                if (GUILayout.Button(skinName, EditorStyles.popup, GUILayout.Width(196)))
                                {
                                    DrawSkinDropdown();
                                }
                            }
                        }
                    }
                }

                EditorGUI.indentLevel--;
                EditorGUI.indentLevel--;
            }
                        #endif
        }
        void DrawUnityTools()
        {
                        #if SPINE_SKELETON_ANIMATOR
            showMecanim = EditorGUILayout.Foldout(showMecanim, new GUIContent("SkeletonAnimator", SpineEditorUtilities.Icons.unityIcon));
            if (showMecanim)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(controller, new GUIContent("Controller", SpineEditorUtilities.Icons.controllerIcon));
                if (controller.objectReferenceValue == null)
                {
                    using (new GUILayout.HorizontalScope()) {
                        GUILayout.Space(32);
                        if (GUILayout.Button(new GUIContent("Generate Mecanim Controller"), GUILayout.Width(195), GUILayout.Height(20)))
                        {
                            SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
                        }
                    }
                    EditorGUILayout.LabelField("SkeletonAnimator is the Mecanim alternative to SkeletonAnimation. It is not required.", EditorStyles.miniLabel);
                }
                else
                {
                    using (new GUILayout.HorizontalScope()) {
                        GUILayout.Space(32);
                        if (GUILayout.Button(new GUIContent("Update Controller Animations"), GUILayout.Width(195), GUILayout.Height(20)))
                        {
                            SkeletonBaker.GenerateMecanimAnimationClips(m_skeletonDataAsset);
                        }
                    }
                }
                EditorGUI.indentLevel--;
            }
                        #endif

            bool pre = showBaking;
            showBaking = EditorGUILayout.Foldout(showBaking, new GUIContent("Baking", SpineEditorUtilities.Icons.unityIcon));
            if (pre != showBaking)
            {
                EditorPrefs.SetBool("SkeletonDataAssetInspector_showUnity", showBaking);
            }

            if (showBaking)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.HelpBox("WARNING!\n\nBaking is NOT the same as SkeletonAnimator!\nDoes not support the following:\n\tFlipX or Y\n\tInheritScale\n\tColor Keys\n\tDraw Order Keys\n\tIK and Curves are sampled at 60fps and are not realtime.\n\tPlease read SkeletonBaker.cs comments for full details.\n\nThe main use of Baking is to export Spine projects to be used without the Spine Runtime (ie: for sale on the Asset Store, or background objects that are animated only with a wind noise generator)", MessageType.Warning, true);
                EditorGUI.indentLevel++;
                bakeAnimations = EditorGUILayout.Toggle("Bake Animations", bakeAnimations);
                EditorGUI.BeginDisabledGroup(!bakeAnimations);
                {
                    EditorGUI.indentLevel++;
                    bakeIK           = EditorGUILayout.Toggle("Bake IK", bakeIK);
                    bakeEventOptions = (SendMessageOptions)EditorGUILayout.EnumPopup("Event Options", bakeEventOptions);
                    EditorGUI.indentLevel--;
                }
                EditorGUI.EndDisabledGroup();

                EditorGUI.indentLevel++;
                using (new EditorGUILayout.HorizontalScope()) {
                    if (GUILayout.Button(new GUIContent("Bake All Skins", SpineEditorUtilities.Icons.unityIcon), GUILayout.Height(32), GUILayout.Width(150)))
                    {
                        SkeletonBaker.BakeToPrefab(m_skeletonDataAsset, m_skeletonData.Skins, "", bakeAnimations, bakeIK, bakeEventOptions);
                    }

                    string skinName = "<No Skin>";

                    if (m_skeletonAnimation != null && m_skeletonAnimation.skeleton != null)
                    {
                        Skin bakeSkin = m_skeletonAnimation.skeleton.Skin;
                        if (bakeSkin == null)
                        {
                            skinName = "Default";
                            bakeSkin = m_skeletonData.Skins.Items[0];
                        }
                        else
                        {
                            skinName = m_skeletonAnimation.skeleton.Skin.Name;
                        }

                        using (new EditorGUILayout.VerticalScope()) {
                            if (GUILayout.Button(new GUIContent("Bake " + skinName, SpineEditorUtilities.Icons.unityIcon), GUILayout.Height(32), GUILayout.Width(250)))
                            {
                                SkeletonBaker.BakeToPrefab(m_skeletonDataAsset, new ExposedList <Skin>(new [] { bakeSkin }), "", bakeAnimations, bakeIK, bakeEventOptions);
                            }
                            using (new EditorGUILayout.HorizontalScope()) {
                                GUILayout.Label(new GUIContent("Skins", SpineEditorUtilities.Icons.skinsRoot), GUILayout.Width(50));
                                if (GUILayout.Button(skinName, EditorStyles.popup, GUILayout.Width(196)))
                                {
                                    SelectSkinContext();
                                }
                            }
                        }
                    }
                }
                EditorGUI.indentLevel--;
                EditorGUI.indentLevel--;
            }
        }
		public static void UpdateMecanimClips (SkeletonDataAsset skeletonDataAsset) {
			if (skeletonDataAsset.controller == null)
				return;

			SkeletonBaker.GenerateMecanimAnimationClips(skeletonDataAsset);
		}