Version: 2020.3
言語: 日本語
Unity 5.0 の AI
Unity 5.0 のオーディオ

Unity 5.0 のアニメーション

アニメーション機能を使用している場合は、Unity 4 から Unity 5 へ移行するときに注意しなければいけない点があります。

アセットを作成する API

Unity 5 には、スクリプトで Mecanim 関連のアセットを作成/編集する API を導入しています。非推奨でしたが Unity 4 のときに UnityEditorInternal 名前空間の API でアセットを作成していたユーザーは手動で新しい API へと変更する必要があります。

対応表:

変更前: 変更後:
UnityEditorInternal.BlendTree UnityEditor.Animations.BlendTree
UnityEditorInternal.AnimatorController UnityEditor.Animations.AnimatorController
UnityEditorInternal.StateMachine UnityEditor.Animations.AnimatorStateMachine
UnityEditorInternal.State UnityEditor.Animations.AnimatorState
UnityEditorInternal.AnimatorControllerLayer UnityEditor.Animations.AnimatorControllerLayer
UnityEditorInternal.AnimatorControllerParameter UnityEditor.Animations.AnimatorControllerParameter

また、ほとんどのアクセスメソッドは配列の変数に変更されました。

UnityEditorInternal.AnimatorControllerLayer layer = animatorController.GetLayer(index);

変更後:

UnityEditor.Animations.AnimatorControllerLayer layer = animatorController.layers[index];

API の基本的な使い方はこちらのブログで紹介しています。http://blogs.unity3d.com/2014/06/26/shiny-new-animation-features-in-unity–5–0/

さらに詳しい詳細はスクリプトリファレンスを参照してください。

Unity 5.0 の AI
Unity 5.0 のオーディオ