dccoo
1
There are 2 scenes PreGame and Game. I start in PreGame and then it loads Game.
When Game is loaded, a video plays before the game really starts.
When the player dies, the scene Game is reloaded, and the video plays again.
My goal is to make the video play always Game is initially loaded, but never when it is reloaded.
How can I do this without using PlayerPrefs or any more complicated stuff?
Either use a 3rd scene or use a static variable, once set, it will persist between scene loads
private static bool introVideoPlayed = false;
if (!introVideoPlayed)
{
PlayVideo();
introVideoPlayed = true;
}
dccoo
4
but when the scene reloads, will the static variable reset to its original value?
Not for that play session
You can save this value at the playerpref to resolved this.
But why not on the pregame scene after the player hits the “new game” button play the video first and then send him to the game scene?