Example #1
0
        protected virtual AssetDatabase CreateAssetDatabase(ISerializationBinder binder)
        {
            var fileAssets = new LooseFileDatabase(_assetRootPath);

            fileAssets.DefaultSerializer.SerializationBinder = 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);
        }
Example #2
0
 public AssetSystem(string assetRootPath, ISerializationBinder binder)
 {
     _assetRootPath = assetRootPath;
     _ad            = CreateAssetDatabase(binder);
     LooseFileDatabase.AddExtensionTypeMapping(".scene", typeof(SceneAsset));
 }