Created
June 4, 2017 18:58
-
-
Save unity3dcollege/5fd276fd6396afa8a86a84cdd3c025cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using UnityEngine; | |
using UnityEngine.SceneManagement; | |
public class Loader : MonoBehaviour | |
{ | |
private AssetBundleCreateRequest bundleRequest; | |
private void Start() | |
{ | |
bundleRequest = AssetBundle.LoadFromFileAsync(Path.Combine(Application.streamingAssetsPath, "level1")); | |
if (bundleRequest == null) | |
{ | |
Debug.Log("Failed to load AssetBundle!"); | |
return; | |
} | |
} | |
private void Update() | |
{ | |
if (bundleRequest.isDone) | |
{ | |
SceneManager.LoadScene("Level1"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment