0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Animation・Animator メモ

Last updated at Posted at 2020-02-10

全然知識がアップデートされてないのでメモ

■Animatorがアタッチされているゲームオブジェクトは、
 アクティブになっていると(厳密にはオブジェクトのアクティブ+Animatorスクリプトのenabled=trueのような気がする)
 自動的に再生される。

 下記のように、必ず遷移先を逃がさないとenabled=trueとenabled=false を切り替えても2回目以降のアニメーションが
 再生されない。(ちょっと調べたけどわからん)
 animationPauseState.png


できた。下記の方のようにPlayメソッドに再生位置を指定してやればいける。

XXXXX.enabled = true;
XXXXX.Play("DialogEnd",0,0.0f);

URLもう1回再生
https://spphire9.wordpress.com/2015/02/13/unityでアニメーションをもう一度再生する/

下記のアニメーター構成でも動作する。
animationReplay.png

■AnimationのLoop Timeはチェックがついているとループアニメーションになって、再生され続ける。

 ●アニメーションクリップ
  参考URL
  https://docs.unity3d.com/jp/460/Manual/class-AnimationClip.html

■スクリプトのメソッドを呼びたければ、時間の下あたりで右クリックすると
 「Add Animation Event」をクリックするとメソッドの選択プルダウンが表示されるので選ぶ。
 ボタンと違ってprivateメソッドでも呼べるっぽい

animationトリガー.png

■アニメーション止める
XXXXX.enabled = false;

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?