public static GetFileHash ( string path, bool force = false ) : string | ||
path | string | |
force | bool | |
Résultat | string |
public string GetHash() { if (type == AssetType.Builtin) { return("0000000000"); } else { return(AssetBundleUtils.GetFileHash(file.FullName)); } }
public string GetHash() { if (type == AssetType.Builtin) { return("0000000000"); } else #region 2018年8月28日15:19:05 HCFeng修改为写入ab与ab的依赖文件的哈希值 { //return AssetBundleUtils.GetFileHash(file.FullName); return(AssetBundleUtils.GetFileHash(bundleSavePath) + "|" + AssetBundleUtils.GetFileHash(bundleSavePath + ".manifest")); } #endregion }
/// <summary> /// Texture /// AudioClip /// Mesh /// Model /// Shader /// 这些类型的Asset的一配置是放在.meta中的,所以要监视它们的变化 /// 而在5x中系统会自己处理的,不用管啦 /// </summary> void LoadMetaHashIfNecessary() { bool needLoad = false; if (typeof(Texture).IsInstanceOfType(asset) || typeof(AudioClip).IsInstanceOfType(asset) || typeof(Mesh).IsInstanceOfType(asset) || typeof(Shader).IsInstanceOfType(asset)) { needLoad = true; } if (!needLoad) { AssetImporter importer = AssetImporter.GetAtPath(assetPath); needLoad = typeof(ModelImporter).IsInstanceOfType(importer); } if (needLoad) { _metaHash = AssetBundleUtils.GetFileHash(assetPath + ".meta"); } }