이 섹션에서는 Video Player 컴포넌트에 사용할 수 있는 다양한 시간 업데이트 모드와 상호 작용 방식을 설명합니다.
Video Player 컴포넌트를 사용하여 다른 인터랙티브 동작을 기준으로 동영상 재생 시간을 제어할 수 있습니다. 예를 들어 동영상 재생을 애니메이션 또는 오디오와 동기화할 수 있습니다. 다음 시간 업데이트 모드를 통해 이 작업을 수행할 수 있습니다.
Video Player는 Unity의 캡처 프레임 속도 (Time.captureFramerate
) 및 캡처 델타 시간 (Time.captureDeltaTime
)]을 따릅니다.
캡처 프레임 속도를 지정하면 Video Player의 재생이 동기화되므로, 전체 게임 실행이 지연되더라도 Video Player는 예상되는 타임스탬프에 모든 프레임을 표시합니다. 캡처 프레임 속도의 또 다른 장점은 준비 및 탐색 작업을 차단하여 일관되고 정확한 결과를 얻을 수 있게 한다는 것입니다. 하지만 동영상이 나머지 씬과 동기화 상태를 유지해야 하는 경우 게임 실행 속도가 느려질 수 있습니다. 예를 들어 Unity 레코더는 이 특수한 시간 동작을 사용하여 원활한 녹화를 수행합니다.
캡처 프레임 속도는 게임 시간에만 영향을 줍니다. 캡처 프레임 속도를 사용하는 동안 Video Player가 스케일링되지 않은 게임 시간 또는 오디오 DSP 클럭을 사용하는 경우, Video Player는 캡처 프레임 속도를 무시하고 비동기 재생을 사용합니다. 따라서 Video Player는 필요한 경우 프레임을 건너뛰거나 반복하며, 준비 또는 탐색 작업은 재생이 차단되는 것을 방지하기 위해 비동기식으로 수행됩니다. 그러나 이는 게임 시간을 Video Player의 시간 업데이트 모드로 선택한 경우에만 발생합니다.
Note: On WebGL, Unity’s Video Player doesn’t support synchronous playback with captureFramerate
. By default, it uses the normal asynchronous playback that’s described with the Game time update mode.
오디오 DSP 클럭은 오디오 모듈에서 옵니다. AudioSettings.dspTime
을 통해 액세스할 수 있습니다.
게임 시간은 시간 모듈에서 설정합니다. C#을 사용하여 Time.time
을 통해 액세스할 수 있습니다. 스케일링된 게임 시간이라고도 하는 게임 시간을 사용하면 Unity는 Time 창에 설정된 Time Scale 값을 따릅니다. C#을 사용하여 Time.timeScale
을 통해 Time Scale 값을 수정할 수도 있습니다. 그러나 캡처 프레임 속도 또는 캡처 델타 시간의 값이 0이 아닌 경우, 게임 시간은 시간 관리자의 캡처 프레임 속도 기능에 적용되는 규칙에 따라 변경됩니다.
참고: 캡처 델타 시간은 1을 캡처 프레임 속도로 나눈 값과 동일합니다. 이렇게 동일한 정보를 다른 방식으로 볼 수 있습니다.
스케일링되지 않은 게임 시간을 사용하면 Video Player에서 Time Scale 값을 무시합니다. 스케일링되지 않은 게임 시간은 Time 모듈에서 옵니다. C#을 사용하여 Time.unscaledTime
을 통해 액세스할 수 있습니다.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.