Scenes transition
Scenes transition
Hello, so I tried to apply today scenes transition via Scene Portal Script and it works great, also with Scene Fader. But how can I also use it when I start game in Main Menu and click New Game, how can I use this transition function with fader in this case?
Re: Scenes transition
Hi,
When you click New Game, does it load a different scene? Or is it still in the main menu scene?
If it's in the main menu scene, you can manually trigger the SceneFaderCanvas's animation states (Show and Hide).
If New Game loads a different scene, make sure to load the scene using any of these techniques. They will use the StandardSceneTransitionManager.
When you click New Game, does it load a different scene? Or is it still in the main menu scene?
If it's in the main menu scene, you can manually trigger the SceneFaderCanvas's animation states (Show and Hide).
If New Game loads a different scene, make sure to load the scene using any of these techniques. They will use the StandardSceneTransitionManager.
Re: Scenes transition
New Game loads a different scene in my case, and I already added
to my script and it works. But previously I was using:
And now I have problem, because GameMenu was opening after screen fades out, but now it turns on immediately, and I dont know how to use yield or another solution in that case.
Code: Select all
PixelCrushers.SaveSystem.LoadScene("Area 0");
GameMenu.Open();
Code: Select all
private IEnumerator OnPlayPressedRoutine()
{
TransitionFader.PlayTransition(startTransitionPrefab);
yield return new WaitForSeconds(_playDelay);
Game.LevelLoader.Instance.LoadLevelAsync(1);
GameMenu.Open();
}
Re: Scenes transition
Hi,
There are a few ways to do that. Here are some of them:
- You can add a script to your "Area 0" scene. In the script's Start() method, call GameMenu.Open().
- Or hook into the PixelCrushers.SaveSystem.sceneLoaded event:
There are a few ways to do that. Here are some of them:
- You can add a script to your "Area 0" scene. In the script's Start() method, call GameMenu.Open().
- Or hook into the PixelCrushers.SaveSystem.sceneLoaded event:
Code: Select all
SaveSystem.sceneLoaded += OnSceneLoaded;
void OnSceneLoaded(string sceneName, int sceneIndex)
{
SaveSystem.sceneLoaded -= OnSceneLoaded;
GameMenu.Open();
}
Re: Scenes transition
Yes, second option works perfectly, thank you!