Skip to content

Instantly share code, notes, and snippets.

@unity3dcollege
Created June 4, 2017 18:58
Show Gist options
  • Save unity3dcollege/5fd276fd6396afa8a86a84cdd3c025cf to your computer and use it in GitHub Desktop.
Save unity3dcollege/5fd276fd6396afa8a86a84cdd3c025cf to your computer and use it in GitHub Desktop.
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