public override void AssetLoadingGameProgressEventHandler(AssetLoadingGameProgressEvent data) { base.AssetLoadingGameProgressEventHandler(data); if (data.Progress != 1f) return; //This is the key part: we check that asset loading procedure is finished this.Publish(new UnloadSceneCommand() //Unload AssetsLoadingScene { SceneName = "AssetsLoadingScene" }); this.Publish(new LoadSceneCommand() // Load MainMenuScene { SceneName = "MainGameScene" }); }
/// <summary> // This method is executed when using this.Publish(new AssetLoadingGameProgressEvent()) /// </summary> public virtual void AssetLoadingGameProgressEventHandler(AssetLoadingGameProgressEvent data) { // Process the commands information. Also, you can publish new events by using the line below. // this.Publish(new AnotherEvent()) }