資源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]},
初步簡介,後續對每種資源逐一簡介。
若是喜歡 能夠粉我 哦😘