Beispiel #1
0
        public static AssetData LoadAsset(
            this TarArchiveReader reader,
            TarArchiveReader.Header hdr,
            UGUI creator)
        {
            var asset = new AssetData
            {
                ID       = UUID.Parse(hdr.FileName.Substring(7, 36)),
                FileName = hdr.FileName,
                Name     = "From Archive",
                Data     = new byte[hdr.Length]
            };

            if (hdr.Length != reader.Read(asset.Data, 0, hdr.Length))
            {
                throw new IOException();
            }

            return(asset);
        }