File tree Expand file tree Collapse file tree
articles/tutorials/advanced/2d_shaders/05_transition_effect Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments