private void _UpdateAssetTableStep() { string path = iter.Current as string; if (_IsIgnoreAsset(path)) { return; } U3DAssetInfo assetInfo = new U3DAssetInfo(); ResourceManageToolUtility.InitAssetInfo(path, ref assetInfo); Guid guid = assetInfo.guid; string[] deps = ResourceManageToolUtility.GetDependencies(path); foreach (var depPath in deps) { Guid depGuid = ResourceManageToolUtility.PathToGuid(depPath); if (depGuid.Equals(guid)) { continue; } assetInfo.deps.Add(depGuid); } resultObj.assetTable.Add(guid, assetInfo); }
private void _GetAssetDependencies(Guid id, out List <U3DAssetInfo> assets) { U3DAssetInfo assetInfo = null; assets = new List <U3DAssetInfo>(); if (!U3DAssetDB.GetInstance().Find(id, out assetInfo)) { return; } string[] depPaths = ResourceManageToolUtility.GetDependencies(assetInfo.path); foreach (var p in depPaths) { if (p.Equals(assetInfo.Path)) { continue; } U3DAssetInfo depAsset = null; Guid depId = ResourceManageToolUtility.PathToGuid(p); //在数据库中没有找到此资源则初始化 if (!U3DAssetDB.GetInstance().Find(depId, out depAsset)) { depAsset = new U3DAssetInfo(); depAsset.guid = depId; ResourceManageToolUtility.InitAssetInfo(p, ref depAsset); U3DAssetDB.GetInstance().AssetTable.Add(depAsset.guid, depAsset); } assets.Add(depAsset); } assets.Sort(new AssetInfoComparer(AssetFilterList)); }
private void _CorruptedAssetsCatchCallback(string condition, string stackTrace, LogType type) { if (condition.Contains("Failed to read file") && condition.Contains("because it is corrupted.") ) {//资源已经破损 string subStr = condition.Substring(condition.IndexOf("Assets")); string corruptedAssetPath = subStr.Substring(0, subStr.LastIndexOf('\'')); corruptedAssets.Add(ResourceManageToolUtility.PathToGuid(corruptedAssetPath)); } }
public bool FindReferencedList(string path, out List <Guid> referencedList) { Guid guid = ResourceManageToolUtility.PathToGuid(path); return(FindReferencedList(guid, out referencedList)); }
//根据路径查找 public bool Find(string path, out U3DAssetInfo info) { Guid guid = ResourceManageToolUtility.PathToGuid(path); return(Find(guid, out info)); }
public bool Contain(string path) { Guid guid = ResourceManageToolUtility.PathToGuid(path); return(assetTable.ContainsKey(guid)); }