Пример #1
0
        protected virtual AssetDatabase CreateAssetDatabase(SerializationBinder binder)
        {
            var fileAssets = new LooseFileDatabase(_assetRootPath);

            fileAssets.DefaultSerializer.Binder = binder;
            fileAssets.RegisterTypeLoader(typeof(WaveFile), new WaveFileLoader());
            LooseFileDatabase.AddExtensionTypeMapping(".wav", typeof(WaveFile));
            fileAssets.RegisterTypeLoader(typeof(FontFace), new FontFaceLoader());
            LooseFileDatabase.AddExtensionTypeMapping(".ttf", typeof(FontFace));
            var embeddedAssets = new EngineEmbeddedAssets();
            var compoundDB     = new CompoundAssetDatabase();

            compoundDB.AddDatabase(fileAssets);
            compoundDB.AddDatabase(embeddedAssets);
            return(compoundDB);
        }
Пример #2
0
        protected override AssetDatabase CreateAssetDatabase(SerializationBinder binder)
        {
            var compoundDB = new CompoundAssetDatabase();

            compoundDB.AddDatabase(new EngineEmbeddedAssets());
            compoundDB.AddDatabase(new EditorEmbeddedAssets());
            _projectAssetDatabase = new LooseFileDatabase("Assets");
            _projectAssetDatabase.DefaultSerializer.Binder = binder;
            _projectAssetDatabase.RegisterTypeLoader(typeof(WaveFile), new WaveFileLoader());
            LooseFileDatabase.AddExtensionTypeMapping(".wav", typeof(WaveFile));
            _projectAssetDatabase.RegisterTypeLoader(typeof(FontFace), new FontFaceLoader());
            LooseFileDatabase.AddExtensionTypeMapping(".ttf", typeof(FontFace));

            compoundDB.AddDatabase(_projectAssetDatabase);
            return(compoundDB);
        }
Пример #3
0
 public AssetSystem(string assetRootPath, SerializationBinder binder)
 {
     _assetRootPath = assetRootPath;
     _ad            = CreateAssetDatabase(binder);
     LooseFileDatabase.AddExtensionTypeMapping(".scene", typeof(SceneAsset));
 }