我正在使用SceneManager.LoadScene加载使用Unity的新视频播放器组件的场景。考虑到360胶片上发生的瞬间停滞,而之前的场景正在被摧毁-我决定使用RawImage动画作为从完全透明到黑色的过渡。这掩盖了问题,但就在下一个视频加载之前,前一个视频中的一个帧出现在过渡之后和LoadScene之前,它会立即继续该过渡。任何解决这个问题的方法都将不胜感激!与此相关的代码如下:
sphere.GetComponent<VideoPlayer>().Pause();
rawImage.GetComponent<Animation> ().Play ("FadeOut");
yield return new WaitForSeconds (0.5f); //matches length of time of animation
SceneManager.LoadScene (scene_Name);

我被建议在脚本中完成这一切,但使用下面的代码我遇到了完全相同的问题。
rawImage.GetComponent<RawImage> ().enabled = true;
sphere.GetComponent<VideoPlayer>().Pause();
for (int i = 0; i < 101; i++) {
float transitionCounter = i / 100f;
yield return new WaitForSeconds (0.0001f);
Color temp = rawImage.GetComponent<RawImage> ().color;
temp.a = transitionCounter;
rawImage.GetComponent<RawImage> ().color = temp;
}
SceneManager.LoadScene (scene_Name);谢谢!
发布于 2017-10-03 00:21:15
终于解决了这个问题。最简单的解决方案是在从黑色开始的下一个场景上创建定时淡入。这样,被传递的帧是不可见的。
https://stackoverflow.com/questions/45641725
复制相似问题