zoukankan      html  css  js  c++  java
  • 总结一下asset bundle的相关知识:

    1.通过脚本创建:BuildPipeLine.BuildAssetBundle、BuildPipeline.BuildScreamedSceneAssetBundle、BuildAssetBundleExplictAssetNames
    2.www类下载assetbundle
    var www:WWW = new WWW(url);
    yield www;
    render.material.mainTexture=www.mainAsset;
    或者
    var www=WWW.loadFromCacheOrDownload("http://")
    yield www;
    www.assetbundle.mainasset
    3.从流中创建assetbundle
    www=WWW(url)
    yield return www;
    byte[] data=www.bytes;
    assetbundle = AssetBundle.createfromMemory(data)
    4.从assetbundle中加载具体的asset
    assetbundle.load  / loadasync /loadall
    或者
    application.loadLevel /loadLevelAsync / loadLevelAddtive
    5.实例化assetbundle
    www = new WWW(URL)
    yield www;
    Instantiate(www.assetbundle.mainAsset)
    6.释放
    assetbundle.destory / unload(true/false) / unloadUnusedAssets
    //////////////高级/////////////////////////////////////////////////////////////////////////
    7.assets之间的依赖
    BulidPipeline.PushAssetDependencies  / PopAssetDependencies
    8.Editor与runtime之间共享数据
    切分场景为不同的assetBundles,划分场景的信息单独放在一个assetbundles钟,先加载划分信息
    list<Object> toinclude = new 
    string stringHolderPath = "assets/scriptabel.asset"
    stringHolder content = ScriptableObject.CreateInstance<string>();
    UnityEditor.AssetDatabase.CreateAsset(content,stringholderpath);
    toinclude.add(UnityEditor.assetDatabase.loadAssetAtPath(stringholder,typeof(stringholder)));
    BuildPipeline.bulidAssetBundle(null,toinclude,toarray,testAssetBundlePath);
  • 相关阅读:
    LoadRunner使用记录
    JVM&GC详解
    常用网络操作命令
    IP地址、子网掩码、网络号、主机号、网络地址、主机地址详解
    交换机配置记录
    持续集成与自动化部署---代码流水线管理及Jenkins和gitlab集成
    Git的安装与使用详解
    性能测试---问题记录
    性能测试---实战篇
    c++实用快捷键
  • 原文地址:https://www.cnblogs.com/yuanjing/p/3362069.html
Copyright © 2011-2022 走看看