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);
}

原文地址:https://www.cnblogs.com/hont/p/5093570.html