您的位置:首页 > 其它

关于Resources.Load()和 AssetBundle.Load()

2015-07-22 10:12 218 查看
关于Resources.Load()

Resources.Load();

Resources.LoadAll();

Resources.LoadAssetAtPath();可以找到不在Resources目录下的文件。

例如:

ResourcesManager.Load<AssetBundle>(URL,delegate(UnityEngine.Object object){});

关于AssetBundle.Load()

AssetBundle obj = object as AssetBundle;
if(obj!=null)
{

TextAsset txt = obj.Load("data", typeof(TextAsset)) as TextAsset;
byte[] bytes = txt.bytes;
BinaryFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream(txt.bytes);
Hashtable datas = (Hashtable)formatter.Deserialize(stream);//反序列化
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: