我知道你可以做animation.isPlaying(),但是有类似的东西吗?所以如果我有:
Animator animator;
void Start()
{
animator = GetComponenet<Animator>();
}然后我就可以去:
void Update()
{
if(Input.GetMouseButtonDown(0))
Instantiate(shot, shotSpawn.position, shotSpawn.rotation);
if(!animator.isPlaying("ShootAnimation"))
{
animator.SetTrigger("ShootAnimation"); // play shooting animation
}
}
}发布于 2014-05-03 22:21:08
if (animator.GetCurrentAnimatorStateInfo(0).IsName("YourAnimationName"))
{
// do your magic
}https://stackoverflow.com/questions/23449494
复制相似问题