1.Resources 内嵌资源,工程中放在Resources目录下的资源,加载打入游戏发布包中的资源,使用方法Resources.Load,可以加载任意种类的资源,不能动态修改。
2.StreamingAssets 随包资源,工程中放在StreamingAssets下的资源,存放路径和Resources不相同,使用方法IO或WWW.Load。WWW.Load可以加载任意种类资源,IO仅限bytes 和 text。
3.WWW 从网络加载AssetBundle
private string url = "http://pic14.nipic.com/20110522/7411759_164157418126_2.jpg";
public RawImage image;
void Start () {
StartCoroutine("LoadImage");
}
IEnumerator LoadImage()
{
WWW www = new WWW(url);
yield return www;
if (www != null && string.IsNullOrEmpty(www.error)){
image.texture = www.texture;
}
}