Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,15 @@ We will create a new class called `SceneTransition` that holds all the data for

[!code-csharp[](./snippets/snippet-5-32.cs?highlight=3)]

6. Then we need to actually _set_ the `Progress` shader parameter given the current scene transition value. In the `Update()` method:
6. Before changing scene, we need to wait for the closing transition to be done:

[!code-csharp[](./snippets/snippet-5-40.cs?highlight=7)]

7. Then we need to actually _set_ the `Progress` shader parameter given the current scene transition value. In the `Update()` method:

[!code-csharp[](./snippets/snippet-5-33.cs?highlight=6)]

7. Finally, the scene material needs to be drawn with the right texture:
8. Finally, the scene material needs to be drawn with the right texture:

[!code-csharp[](./snippets/snippet-5-34.cs?highlight=11)]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
protected override void Update(GameTime gameTime)
{
// ...

// if there is a next scene waiting to be switch to, then transition
// to that scene
if (s_nextScene != null && SceneTransition.IsComplete)
{
TransitionScene();
}

// ...
}