Animation.Sample用法介紹


無意中翻到這篇問答LINK,發現了Sample的用法

如果想讓Animation在編輯器狀態下預覽,也可以用這個接口

 

當你想要直接獲得動畫的運行結果,而不是等幀數執行到這,這時候就得調用Sample:

void LateUpdate()
{
    Debug.Log("frame: " + Time.frameCount + " position: " + transform.position);
    var state = anim["Anim2"];
    state.normalizedTime = 5f;
    anim.Sample();
    Debug.Log("Sampled frame: " + Time.frameCount + " position: " + transform.position);
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM