Last active
July 23, 2020 15:14
-
-
Save tsubaki/3054131bba12565f977c to your computer and use it in GitHub Desktop.
選択中のアニメーションをレガシーアニメーションにする。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using UnityEditor; | |
public class ChangeAnimationType | |
{ | |
[MenuItem("Assets/Change Animation Type/Animation", false, 20)] | |
static void ChangeLegacey() | |
{ | |
foreach( var obj in Selection.objects) | |
{ | |
var anim = obj as AnimationClip; | |
if( anim == null) | |
continue; | |
UnityEditor.AnimationUtility.SetAnimationType(anim, ModelImporterAnimationType.Legacy); | |
AssetDatabase.ImportAsset( AssetDatabase.GetAssetPath(obj)); | |
} | |
} | |
[MenuItem("Assets/Change Animation Type/Animator", false, 20)] | |
static void ChangeGeneral() | |
{ | |
foreach( var obj in Selection.objects) | |
{ | |
var anim = obj as AnimationClip; | |
if( anim == null) | |
continue; | |
UnityEditor.AnimationUtility.SetAnimationType(anim, ModelImporterAnimationType.Generic); | |
AssetDatabase.ImportAsset( AssetDatabase.GetAssetPath(obj)); | |
} | |
} | |
} |
Projectビューでアニメーションを選択し、
「Change Animation Type→Animation」でAnimation(Legacey)、
「Change Animation Type→Animator」でAnimator(Generic)のタイプに変更する
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
5系でレガシーアニメーションが作りにくくなったのでその対策。
エディタ拡張なので、Editorフォルダ作ってその中に入れて使う感じ