资源AssetBundle学习总结:json
一:资源更新须要打包的资源包括:学习
二:打包流程动画
shader :ui
1)查找.shader.meta 文件spa
2)修改.meta文件后缀名3d
3)读取并拼接meta 文件内容到新文件orm
4)修改资源附属属性(无关紧要,附属属性包括,是否能及时销毁,是否能使用unload false卸载等等)ci
例如characterColorful.shader.mata:资源
标记过的:string
fileFormatVersion: 2
guid: e7a8c425033db05408db07eec14c5b87
timeCreated: 1470196199
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName: shader/pal_shader.ab
assetBundleVariant:
assetCanBeDestroyImmediate: 0
assetBelongAbCanBeUnloadFalse: 0
assetNeedBeShow: 1
assetOnlyShowAb: 0
未标记过的:
fileFormatVersion: 2
guid: e7a8c425033db05408db07eec14c5b87
timeCreated: 1470196199
licenseType: Free
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
注:不少资源都会有依赖关系,举得例子中 shader 脚本 没有对其余资源依赖关系
可是每一个资源在配置文件中数据信息 格式是一致的。
例如:
public string assetKey = string.Empty;
public string assetPath = string.Empty;
public string assetShortName = string.Empty;
public Int64 id = 0;
public int abID = 0;
public bool isEntry = true;//入口文件
public bool abCanUnloadFalse = false;//资源在的ab是否能够unload(false)
public bool canDestroyImmediate = false;
public List<String> depencies = new List<string>();
public string masterAssetPath = string.Empty;
public bool needShowName = true;//须要在配置中标记资源的名称
public bool onlyShowAb = false; // 在配置中只显示资源的ab名字
public int assetLoadType = -1;
public int assetType = -1;
}
特效:
Meta 标记 修改:
fileFormatVersion: 2
guid: 6120a9db2244a7f469dd3a5f2e07f28f
timeCreated: 1476676623
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName: effect/prefab/action/ef_0001_yangmi_isattack.ab
assetBundleVariant:
assetCanBeDestroyImmediate: 1
assetBelongAbCanBeUnloadFalse: 1
assetNeedBeShow: 1
assetOnlyShowAb: 0
5.)检测重复
6)获取依赖关系
8)生成json配置文件:
如 [{"n":"effect/prefab/action/ef_0001_yangmi_isattack", "s":"1", "c":"1","p":"1","a":"2", "d":[145,171,400]},
初步简介,后续对每种资源逐一简介。
若是喜欢 能够粉我 哦😘