unity3D中判斷動畫是否播放完畢

bool IsAnimationPlaying(GameObject objWithAnimation,string animationName)


    {       

 return  objWithAnimation.animation.IsPlaying(animationName)&&objWithAnimation.animation[animationName].normalizedTime<<span>1.0f;
    }    }

判斷某個動畫是否播放完畢。動畫

IEnumerator WaitForAnimationPlayOver(GameObject objWithAnimation,string animationName)


    {  

      yield return new WaitForSeconds(objWithAnimation.animation[animationName].length);
    }    }

等待某個動畫播放完成。spa

normalizedTime: 範圍0 -- 1,  0是動做開始,1是動做結束orm

相關文章
相關標籤/搜索