0
SceneManager.LoadSceneを使用して、Unityの新しいビデオプレーヤーコンポーネントを使用するシーンを読み込みます。前のシーンが破壊されている間に360フィルムで起こる瞬間的な失速を考えると、RawImageアニメーションを完全に透明から黒に移行することに決めました。これで問題は隠されますが、次のビデオがロードされる直前に、トランジション後とLoadSceneの前に、直前のビデオからフレームが表示されます。これを解決する方法は非常に高く評価されます!次のようにこれに関連するコードは次のとおりです。私はすべてのスクリプトでこれを行うことをお勧めしますが、私は正確に同じ問題を抱えています下のコードを使用していたSceneManager.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);
ありがとうございます!
どのようにビデオを再生していますか?答えはそれに依存します。 – Programmer
ビデオが「覚醒時に再生」に設定されています。 – owlwink
スクリプトからビデオを再生しない場合は、「インスペクタ」タブにVideoPlayerコンポーネントのスクリーンショットを投稿します。 – Programmer