Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active July 23, 2020 15:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/3054131bba12565f977c to your computer and use it in GitHub Desktop.
Save tsubaki/3054131bba12565f977c to your computer and use it in GitHub Desktop.
選択中のアニメーションをレガシーアニメーションにする。
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));
}
}
}
@tsubaki
Copy link
Author

tsubaki commented Dec 2, 2014

5系でレガシーアニメーションが作りにくくなったのでその対策。

エディタ拡張なので、Editorフォルダ作ってその中に入れて使う感じ

@tsubaki
Copy link
Author

tsubaki commented Dec 2, 2014

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