Animator anim = this.GetComponent<Animator>();
AnimatorStateInfo animatorInfo;
animatorInfo = anim.GetCurrentAnimatorStateInfo(0);
if (IsOk)
{
anim.SetTrigger(str);
}
if ((animatorInfo.normalizedTime > 1) && (animatorInfo.IsName(str)))
{
IsOk = true;
//print("动画播放完了");
GameManager._Instance.IsPlay = false;
GameManager._Instance.OpenRay();
}
else
{
IsOk = false;
GameManager._Instance.CloseRay();
//print("动画正在播放中");
}