private void LoadAssetsFromMemory(string fullName, EndianBinaryReader reader, string originalPath, string unityVersion = null) { var upperFileName = Path.GetFileName(fullName).ToUpper(); if (!assetsFileListHash.Contains(upperFileName)) { try { var assetsFile = new SerializedFile(this, fullName, reader); assetsFile.originalPath = originalPath; if (assetsFile.header.m_Version < 7) { assetsFile.SetVersion(unityVersion); } assetsFileList.Add(assetsFile); assetsFileListHash.Add(assetsFile.upperFileName); } catch { //Logger.Error($"Unable to load assets file {fileName} from {Path.GetFileName(originalPath)}"); } finally { resourceFileReaders.Add(upperFileName, reader); } } }
private void LoadAssetsFromMemory(FileReader reader, string originalPath, string unityVersion = null) { if (!assetsFileListHash.Contains(reader.FileName)) { try { var assetsFile = new SerializedFile(reader, this); assetsFile.originalPath = originalPath; if (!string.IsNullOrEmpty(unityVersion) && assetsFile.header.m_Version < SerializedFileFormatVersion.kUnknown_7) { assetsFile.SetVersion(unityVersion); } CheckStrippedVersion(assetsFile); assetsFileList.Add(assetsFile); assetsFileListHash.Add(assetsFile.fileName); } catch (Exception e) { Logger.Error($"Error while reading assets file {reader.FullPath} from {Path.GetFileName(originalPath)}", e); resourceFileReaders.Add(reader.FileName, reader); } } else { Logger.Info($"Skipping {originalPath} ({reader.FileName})"); } }
private void LoadAssetsFromMemory(string fullName, EndianBinaryStream stream, string originalPath, string unityVersion = null) { var fileName = Path.GetFileName(fullName); if (!assetsFileListHash.Contains(fileName)) { try { var assetsFile = new SerializedFile(this, fullName, stream) { originalPath = originalPath }; if (assetsFile.header.m_Version < 7) { assetsFile.SetVersion(unityVersion); } assetsFileList.Add(assetsFile); assetsFileListHash.Add(assetsFile.fileName); } catch { //Logger.Error($"Unable to load assets file {fileName} from {Path.GetFileName(originalPath)}"); resourceFileStreams.Add(fileName, stream); } } }
public void CheckStrippedVersion(SerializedFile assetsFile) { if (assetsFile.IsVersionStripped && string.IsNullOrEmpty(SpecifyUnityVersion)) { throw new Exception("The Unity version has been stripped, please set the version in the options"); } if (!string.IsNullOrEmpty(SpecifyUnityVersion)) { assetsFile.SetVersion(SpecifyUnityVersion); } }
private void LoadAssetsFromMemory(string fullName, EndianBinaryReader reader, string originalPath, string unityVersion = null) { var fileName = Path.GetFileName(fullName); if (!assetsfileListHash.Contains(fileName.ToUpper())) { var assetsFile = new SerializedFile(this, fullName, reader); if (assetsFile.valid) { assetsFile.originalPath = originalPath; if (assetsFile.header.m_Version < 7) { assetsFile.SetVersion(unityVersion); } assetsFileList.Add(assetsFile); assetsfileListHash.Add(assetsFile.upperFileName); } resourceFileReaders.Add(assetsFile.upperFileName, assetsFile.reader); } }
private void LoadAssetsFromMemory(string fullName, EndianBinaryReader reader, string originalPath, string unityVersion = null) { var fileName = Path.GetFileName(fullName); if (!assetsFileListHash.Contains(fileName)) { try { var assetsFile = new SerializedFile(this, fullName, reader); assetsFile.originalPath = originalPath; if (assetsFile.header.m_Version < SerializedFileFormatVersion.kUnknown_7) { assetsFile.SetVersion(unityVersion); } assetsFileList.Add(assetsFile); assetsFileListHash.Add(assetsFile.fileName); } catch (Exception e) { Logger.Error($"Error while reading assets file {fileName} from {Path.GetFileName(originalPath)}", e); resourceFileReaders.Add(fileName, reader); } } }