示例#1
0
        /// <summary>
        /// Unpacks asset indices to real data
        /// </summary>
        /// <param name="asset"></param>
        /// <param name="package"></param>
        /// <param name="record"></param>
        public void UnpackAsset(Asset asset, out ApplicationPackageManifest.PackageHeader package, out ApplicationPackageManifest.PackageRecord record)
        {
            if (asset.m_packageIdx < 0)
            {
                package = new ApplicationPackageManifest.PackageHeader();
                ContentManifestFile contentManifest;

                if (asset.m_packageIdx == PACKAGE_IDX_FAKE_ROOT_CMF)
                {
                    contentManifest = m_rootContentManifest;
                }
                else if (asset.m_packageIdx == PACKAGE_IDX_FAKE_TEXT_CMF)
                {
                    contentManifest = m_textContentManifest;
                }
                else if (asset.m_packageIdx == PACKAGE_IDX_FAKE_SPEECH_CMF)
                {
                    contentManifest = m_speechContentManifest;
                }
                else
                {
                    throw new Exception("wat");
                }
                record = new ApplicationPackageManifest.PackageRecord {
                    m_GUID = contentManifest.m_hashList[asset.m_recordIdx].GUID
                };
            }
            else
            {
                package = m_packageManifest.m_packages[asset.m_packageIdx];
                record  = m_packageManifest.m_packageRecords[asset.m_packageIdx][asset.m_recordIdx];
            }
        }
示例#2
0
        /// <summary>
        /// Unpacks asset indices to real data
        /// </summary>
        /// <param name="asset"></param>
        /// <param name="package"></param>
        /// <param name="record"></param>
        public void UnpackAsset(Asset asset, out ApplicationPackageManifest.Package package, out ApplicationPackageManifest.PackageRecord record)
        {
            if (asset.PackageIdx < 0)
            {
                package = new ApplicationPackageManifest.Package();
                ContentManifestFile contentManifest;

                // main = -1
                // speech = -2
                if (asset.PackageIdx == -1)
                {
                    contentManifest = MainContentManifest;
                }
                else if (asset.PackageIdx == -2)
                {
                    contentManifest = SpeechContentManifest;
                }
                else
                {
                    throw new Exception("wat");
                }
                record = new ApplicationPackageManifest.PackageRecord {
                    GUID = contentManifest.HashList[asset.RecordIdx].GUID
                };
            }
            else
            {
                package = PackageManifest.Packages[asset.PackageIdx];
                record  = PackageManifest.Records[asset.PackageIdx][asset.RecordIdx];
            }
        }