Skip to content

Instantly share code, notes, and snippets.



Last active Dec 16, 2015
What would you like to do?
using UnityEngine;
using System.Collections;
public class LoadAssetBundle : MonoBehaviour {
IEnumerator Start ()
var resultAssetbundle = AssetBundle.LoadFromFileAsync (Application.streamingAssetsPath + "/sprite");
yield return new WaitWhile (() => resultAssetbundle.isDone == false);
var assetbundle = resultAssetbundle.assetBundle;
var resultObject = assetbundle.LoadAssetAsync<GameObject> ("Player");
yield return new WaitWhile (() => resultObject.isDone == false);
GameObject.Instantiate (resultObject.asset);
assetbundle.Unload (false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.