Skip to content

Commit ee36792

Browse files
committed
Add missing snippet and bullet point 05_transition_effect
1 parent be21ea7 commit ee36792

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

articles/tutorials/advanced/2d_shaders/05_transition_effect/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,15 @@ We will create a new class called `SceneTransition` that holds all the data for
397397

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

400-
6. Then we need to actually _set_ the `Progress` shader parameter given the current scene transition value. In the `Update()` method:
400+
6. Before changing scene, we need to wait for the closing transition to be done:
401+
402+
[!code-csharp[](./snippets/snippet-5-40.cs?highlight=7)]
403+
404+
7. Then we need to actually _set_ the `Progress` shader parameter given the current scene transition value. In the `Update()` method:
401405

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

404-
7. Finally, the scene material needs to be drawn with the right texture:
408+
8. Finally, the scene material needs to be drawn with the right texture:
405409

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
protected override void Update(GameTime gameTime)
2+
{
3+
// ...
4+
5+
// if there is a next scene waiting to be switch to, then transition
6+
// to that scene
7+
if (s_nextScene != null && SceneTransition.IsComplete)
8+
{
9+
TransitionScene();
10+
}
11+
12+
// ...
13+
}

0 commit comments

Comments
 (0)