/* * We handle this event to get the moment, when asset loading is finished, so we can move to * Main Menu scene */ public override void AssetLoadingProgressEventHandler(AssetLoadingProgressEvent data) { base.AssetLoadingProgressEventHandler(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 = "MainMenuScene" }); }
/* * We handle this event to get the moment, when asset loading is finished, so we can move to * Main Menu scene */ public override void AssetLoadingProgressEventHandler(AssetLoadingProgressEvent data) { base.AssetLoadingProgressEventHandler(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 = "MainMenuScene" }); }
/// <sumarry> // This method is executed when using this.Publish(new AssetLoadingProgressEvent()) /// </sumarry> public override void AssetLoadingProgressEventHandler(AssetLoadingProgressEvent data) { base.AssetLoadingProgressEventHandler(data); // Process the commands information. Also, you can publish new events by using the line below. // this.Publish(new AnotherEvent()) Debug.Log("--- AssetLoadingProgressEventHandler ---"); 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 = "MainMenuScene" }); }
/// <summary> // This method is executed when using this.Publish(new AssetLoadingProgressEvent()) /// </summary> public virtual void AssetLoadingProgressEventHandler(AssetLoadingProgressEvent data) { // Process the commands information. Also, you can publish new events by using the line below. // this.Publish(new AnotherEvent()) }
public virtual void AssetLoadingProgressEventHandler(AssetLoadingProgressEvent data) { }