Quantcast
Channel: Questions in topic: "loadlevelasync"
Viewing all articles
Browse latest Browse all 194

How to stack LoadLevelAsync and multiple LoadLevelAdditiveAsync?

$
0
0
Hello there. I'm trying to make a loading scene for my game. The game have a MainMenu scene, a Game scene which contain the mail game mechanics and multiple Levelxx scenes which contains the levels assets. I want to load both the Game and Levelxx scene asynchroneously, but I'm having quite a problem. The main idea is to have : void Start() { Application.LoadLevelAsync("Game"); Application.LoadLevelAdditiveAsync("Levelxx"); } The issue is, when LoadLevelAsync finish its work, it change level immediately before calling LoadLevelAdditiveAsync. Fine. I'll wait for it to finish working. IEnumerator Start() { ASyncOperation gameLoad = Application.LoadLevelAsync("Game"); gameLoad.allowSceneActivation = false; ASyncOperation levelLoad = Application.LoadLevelAdditiveAsync("Levelxx"); yield return levelLoad ; gameLoad.allowSceneActivation = true; } This seems fine at first glance BUT the LoadLevelAdditiveAsync can't load until the previously AsyncOperation is done, but it will never get done as I allow it after the LoadLevelAdditiveAsync is itself done, the scene loading just never end. In all, I can't find how I can load a level separated into multiple scenes with the async ops. Anyone know of a way to get it to work?

Viewing all articles
Browse latest Browse all 194

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>