[펌] animation.sample() usage
Unity3D/Script / 2019. 5. 9. 10:52
It forces to sample current state of animations. "Sample animations" means: put character in the position defined by animation states. Sampling always happens between Update and LateUpdate automatically, but in some cases you might want to sample animations yourself. My most common case: I want to put character in pose of first frame some specific animation on Start, so I would do something like this:
void Start()
{
AnimationState state = animation["Aim"];
state.enabled = true;
state.weight = 1;
state.normalizedTime = 0;
animation.Sample();
}
[출처] https://answers.unity.com/questions/46869/animationsample-usage.html
반응형
'Unity3D > Script' 카테고리의 다른 글
[펌] Unity5のPostProcessBuildでXcode Capabilityの設定する方法 (0) | 2019.06.03 |
---|---|
[펌] Enable Push Notification in XCode project by default? (0) | 2019.06.03 |
[펌] 타임서버에서 시각 가져와서 Unity 에서 사용하기 (NST, NIST) (0) | 2019.04.15 |
[펌] Async-Await instead of coroutines in Unity 2017 (0) | 2019.02.21 |
[펌] 웹 페이지 상의 이미지를 읽어와 출력하기 (0) | 2018.12.21 |