This document is about: QUANTUM 3
SWITCH TO

インストール

  1. Unityプロジェクトで.unitypackageをインポートします。

  2. ルートのEntityPrototypeゲームオブジェクトを選択し、AnimatorMecanimスクリプトを追加します。

Adding Animator to Prototype
  1. オブジェクト自身または子オブジェクトに、空のUnityAnimatorコンポーネントを追加します。
Adding Unity Animator
  1. 好きなフォルダー内に、新しいAnimatorGraphアセットを作成します。
AnimatorGraph creation
  1. 作成したアセットを選択し、Controllerフィールドに、ベイクしたいUnityAnimator Controllerの参照を渡します。
Unity controller reference
  1. Bake Animator Graphボタンをクリックすると、ステート・遷移・パラメーターなどがアセットにベイクされます。
Baking Animator Graph
  1. エンティティプロトタイプにAnimatorComponentを追加し、Animator Graphフィールドにアセットの参照を渡します。
Adding AnimatorComponent
  1. SystemConfigアセット内に、AnimatorSystemAnimatorBehaviourSystemAnimatorTriggerSystemを追加します。
Adding Systems
  1. ゲームシーンに新しいゲームオブジェクトを作成し、AnimatorViewUpdaterコンポーネントを追加します。
Adding AnimatorViewUpdater
  1. これで初期設定は完了です。決定論的なアニメーションを開始するには、シミュレーションでAnimator APIを使用して、実行時にアニメーションパラメーターを設定するだけです。

基本的なAPIはUnityと類似していて、Animatorの読み書きにはGetter/Setterを使用します。

C#

// Getters
AnimatorComponent.GetBoolean(frame, filter.AnimatorComponent, "Defending");
AnimatorComponent.GetFixedPoint(frame, filter.AnimatorComponent, "Direction");
AnimatorComponent.GetInteger(frame, filter.AnimatorComponent, "State");

// Setters
AnimatorComponent.SetBoolean(frame, filter.AnimatorComponent, "Defending", true);
AnimatorComponent.SetInteger(frame, filter.AnimatorComponent, "Direction", 25);
AnimatorComponent.SetFixedPoint(frame, filter.AnimatorComponent, "Speed", FP._1);
AnimatorComponent.SetTrigger(frame, filter.AnimatorComponent, "Shoot");

古いCustomAnimatorの置換

  1. プロジェクトのバックアップを取る。
  2. QuantumUser/Simulation/QuantumCustomAnimatorを削除する。
  3. QuantumUser/View/CustomAnimatorを削除する。
  4. Scripts/QuantumCustomAnimatorを削除する。
  5. QuantumAnimator.unitypackageをインポートする。
  6. CustomAnimatorを使用しているすべてのスクリプトをAnimatorComponentに置換する。
  7. Frame.UserからCustom.Animator.AnimatorUpdaterを削除する。

CustomAnimatorGraphの置換

CustomAnimatorGraphが動かない場合は、以下の手順を行ってください。

  1. インスペクターをデバッグモードに変更する。
  2. アセットを選択し、アタッチされたControllerを削除する。
  3. Import Mecanim Controllerをクリックする。
  4. Controllerを再アタッチし、Import Mecanim Controllerを再クリックする。
Back to top