/// <summary> /// 重置属性 /// </summary> /// <param name="path"></param> void Reset(string path) { RefCnt = 1; UsingCache = false; OriginPath = path; Path = FileUtil.EraseExtension(path); Name = FileUtil.EraseExtension(FileUtil.GetFullName(path)); Ext = FileUtil.GetExtension(path); _content = null; }
/// <summary> /// 是否有重名资源 /// </summary> /// <param name="path"></param> /// <returns></returns> public bool IsDuplicated(string path, out string duplicatedFile) { duplicatedFile = ""; string name = FileUtil.EraseExtension(path); for (int i = 0; i < Resources.Count; i++) { string alreadyContainsName = Resources[i].Path; if (string.Equals(alreadyContainsName, name, System.StringComparison.OrdinalIgnoreCase)) { duplicatedFile = Resources[i].Path + Resources[i].Ext; return(true); } } return(false); }
//判断 public bool IsBinaryResourceExsitInPkg(string Path) { string noExtPath = FileUtil.EraseExtension(Path); ResPackInfo packInfo = GetResPackInfo(noExtPath); if (packInfo != null) { if (packInfo.GetPackType() == (byte)ResPackType.ResPackTypeBinary) { string realPath = FileUtil.CombinePath(packInfo.Path, Path); if (FileUtil.IsExistInIFSExtraFolder(realPath) || FileUtil.IsFileExistInStreamingAssets(realPath)) { return(true); } } } return(false); }