Skip to content

Instantly share code, notes, and snippets.

@hiyorin
Last active October 20, 2015 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiyorin/3409e82348b2f2ccd543 to your computer and use it in GitHub Desktop.
Save hiyorin/3409e82348b2f2ccd543 to your computer and use it in GitHub Desktop.
LoadLevelAdditiveAsync
using UnityEngine;
using System.Collection;
public class Example : MonoBehaviour
{
void Start ()
{
StartCoroutine (GenerateLoadProcess ("hogehoge"));
}
private IEnumerator GenerateLoadProcess (string sceneName)
{
AsyncOperation asyncOperation = Application.LoadLevelAdditiveAsync (sceneName);
asyncOperation.allowSceneActivation = false;
while (asyncOperation.progress < 0.9f && asyncOperation.isDone == false)
yield return null;
asyncOperation.allowSceneActivation = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment