Exemplo n.º 1
0
 public static SerializedFileScheme LoadScheme(string filePath, string fileName)
 {
     using (SmartStream fileStream = SmartStream.OpenRead(filePath))
     {
         return(ReadScheme(fileStream, filePath, fileName));
     }
 }
Exemplo n.º 2
0
 public static FileScheme LoadScheme(string filePath, string fileName)
 {
     using (SmartStream stream = SmartStream.OpenRead(filePath))
     {
         return(ReadScheme(stream, 0, stream.Length, filePath, fileName));
     }
 }
Exemplo n.º 3
0
        public ResourcesFile FindResourcesFile(ISerializedFile ifile, string resName)
        {
            SerializedFile file = (SerializedFile)ifile;

            resName = FilenameUtils.FixResourcePath(resName);

            // check asset bundles / web files
            string filePath = file.FilePath;

            foreach (ResourcesFile res in m_resources)
            {
                if (res.FilePath == filePath && res.Name == resName)
                {
                    return(res.CreateReference());
                }
            }

            string resPath = m_resourceCallback?.Invoke(resName);

            if (resPath == null)
            {
                return(null);
            }
            using (SmartStream stream = SmartStream.OpenRead(resPath))
            {
                return(new ResourcesFile(stream, resPath, resName, 0, stream.Length));
            }
        }
Exemplo n.º 4
0
 public static SerializedFileScheme LoadScheme(string filePath, string fileName, TransferInstructionFlags flags)
 {
     if (!MultiFileStream.Exists(filePath))
     {
         throw new Exception($"Serialized file at path '{filePath}' doesn't exist");
     }
     using (SmartStream fileStream = SmartStream.OpenRead(filePath))
     {
         return(ReadScheme(fileStream, 0, fileStream.Length, filePath, fileName, flags));
     }
 }
Exemplo n.º 5
0
        public static ResourceFileScheme LoadScheme(string filePath, string fileName)
        {
            if (!FileMultiStream.Exists(filePath))
            {
                throw new Exception($"Resource file at path '{filePath}' doesn't exist");
            }

            using (SmartStream stream = SmartStream.OpenRead(filePath))
            {
                return(ReadScheme(stream, 0, stream.Length, filePath, fileName));
            }
        }
Exemplo n.º 6
0
        public static BundleFileScheme LoadScheme(string filePath)
        {
            if (!FileUtils.Exists(filePath))
            {
                throw new Exception($"Bundle file at path '{filePath}' doesn't exist");
            }
            string fileName = Path.GetFileNameWithoutExtension(filePath);

            using (SmartStream stream = SmartStream.OpenRead(filePath))
            {
                return(ReadScheme(stream, 0, stream.Length, filePath, fileName));
            }
        }