Created
June 4, 2017 19:21
-
-
Save unity3dcollege/ec47f3fa60faea52ee8440bc535aa9d1 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 UnityEngine; | |
using UnityEngine.Networking; | |
using UnityEngine.SceneManagement; | |
public class Loader : MonoBehaviour | |
{ | |
private AssetBundleCreateRequest bundleRequest; | |
private UnityWebRequest request; | |
private void Start() | |
{ | |
request = UnityWebRequest.GetAssetBundle("https://unity3dcollegedownloads.blob.core.windows.net/assetbundles/StreamingAssets/Windows/level1"); | |
request.Send(); | |
} | |
private void Update() | |
{ | |
if (request.isDone) | |
{ | |
AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(request); | |
SceneManager.LoadScene("Level1"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment