Most of the code references
Http://www.58player.com/blog-2537-89690.html
However, its logic is not too rigorous, a comparison can be.
<summary> ////Asynchronous Load scenario/// </summary>public void Loadscene () {if (!string. IsNullOrEmpty (Loadscenepath)) { startcoroutine (Loadscenceasyn ());}}
<summary>///load speed///</summary> public int loadspeed = 1; Private IEnumerator Loadscenceasyn () {Asynop = Application.loadlevelasync (Loadscenepath); if (show = = False | | asynop = = NULL) {yield break; } int displayprogress = 0; int toprogress = 0; Asynop.allowsceneactivation = false; while (Asynop.progress < 0.9f) {toprogress = (int) (asynop.progress * 100); while (Displayprogress < toprogress) {displayprogress + = Loadspeed; Setprogressbarvalue (displayprogress); Yield return new waitforendofframe (); } yield return new Waitforendofframe (); } toprogress = 100; while (Displayprogress < toprogress) {displayprogress + = Loadspeed; Setprogressbarvalue (displayprogress); Yield return new waitforendofframe (); } asynop.allowsceneactivation = true; while (!asynop.isdone) {yield return new waitforendofframe (); } Startdelyhideloadingui (); }
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Loading-Smooth loading