mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-06 05:01:53 +00:00
- Refactored content manager and asset loaders - Asset placeholder - Error asset
61 lines
1.2 KiB
Beef
61 lines
1.2 KiB
Beef
using Bon;
|
|
using GlitchyEngine.Content;
|
|
using System;
|
|
using System.Collections;
|
|
using System.IO;
|
|
using GlitchyEngine;
|
|
|
|
namespace GlitchyEditor.Assets;
|
|
|
|
class ModelAssetPropertiesEditor : AssetPropertiesEditor
|
|
{
|
|
public this(AssetFile asset) : base(asset)
|
|
{
|
|
|
|
}
|
|
|
|
public override void ShowEditor()
|
|
{
|
|
|
|
}
|
|
|
|
public static AssetPropertiesEditor Factory(AssetFile assetFile)
|
|
{
|
|
return new ModelAssetPropertiesEditor(assetFile);
|
|
}
|
|
}
|
|
|
|
[BonTarget, BonPolyRegister]
|
|
class ModelAssetLoaderConfig : AssetLoaderConfig
|
|
{
|
|
|
|
}
|
|
|
|
class ModelAssetLoader : IAssetLoader //, IReloadingAssetLoader
|
|
{
|
|
private static readonly List<StringView> _fileExtensions = new .(){".gltf", ".glb"} ~ delete _;
|
|
|
|
public static List<StringView> FileExtensions => _fileExtensions;
|
|
|
|
public AssetLoaderConfig GetDefaultConfig()
|
|
{
|
|
return new ModelAssetLoaderConfig();
|
|
}
|
|
|
|
public Asset LoadAsset(Stream file, AssetLoaderConfig config, StringView assetIdentifier, StringView? subAsset, IContentManager contentManager)
|
|
{
|
|
//Log.EngineLogger.Assert(subAsset != null);
|
|
|
|
return ModelLoader.LoadMesh(file, subAsset ?? assetIdentifier, 0);
|
|
}
|
|
|
|
public Asset GetPlaceholderAsset(Type assetType)
|
|
{
|
|
return default;
|
|
}
|
|
|
|
public Asset GetErrorAsset(Type assetType)
|
|
{
|
|
return default;
|
|
}
|
|
} |