Scene Switching

From the source code of HTML page that run game, you can see the Prefab instance's ignoreDestroy property is set as true, so even after switching scene, the Prefab instance is still in the scene, just being displayed when swithing scene, after that it's hidden.

So for demonstrating loding screen on scene switching, all we need to do now is just create some scenes, and provide an action to trigger scene switching.

We create RedState, YellowState and BlueState scenes, each one with a corresponding color background and a button for next scene, all the buttons share the same NextState.js script: