Skip to content

Instantly share code, notes, and snippets.

@kankikuchi
Last active December 28, 2015 00:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kankikuchi/7413896 to your computer and use it in GitHub Desktop.
Save kankikuchi/7413896 to your computer and use it in GitHub Desktop.
Unity animation["idle"].speed とCrossFadeQueued 併用による error dt >= 0 の回避
//攻撃アニメーションを実行 AnimeName:攻撃アニメーションの名前(string)
animation.CrossFade(AnimeName);
//遅延実行
Invoke("Invoke_AttackStandy", animation[AnimeName].length / animation[AnimeName].speed - 0.1f);
//待機アニメーションに変更
void Invoke_AttackStandy(){
//BG_AttackStandy:待機アニメーションの名前
animation.CrossFade("BG_AttackStandy",0.3f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment