2025-11-23 14:49:37 +08:00
|
|
|
/**
|
|
|
|
|
* Asset System for ECS Framework
|
|
|
|
|
* ECS框架的资产系统
|
2025-12-03 22:15:22 +08:00
|
|
|
*
|
|
|
|
|
* Runtime-focused asset management:
|
|
|
|
|
* - Asset loading and caching
|
|
|
|
|
* - GUID-based asset resolution
|
|
|
|
|
* - Bundle loading
|
|
|
|
|
*
|
|
|
|
|
* For editor-side functionality (meta files, packing), use @esengine/asset-system-editor
|
2025-11-23 14:49:37 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
// Types
|
|
|
|
|
export * from './types/AssetTypes';
|
|
|
|
|
|
2025-12-03 22:15:22 +08:00
|
|
|
// Bundle format (shared types for runtime and editor)
|
|
|
|
|
export * from './bundle/BundleFormat';
|
|
|
|
|
|
|
|
|
|
// Runtime catalog
|
|
|
|
|
export { RuntimeCatalog, runtimeCatalog } from './runtime/RuntimeCatalog';
|
|
|
|
|
|
2025-11-23 14:49:37 +08:00
|
|
|
// Interfaces
|
|
|
|
|
export * from './interfaces/IAssetLoader';
|
|
|
|
|
export * from './interfaces/IAssetManager';
|
2025-12-03 22:15:22 +08:00
|
|
|
export * from './interfaces/IAssetReader';
|
2025-11-25 22:23:19 +08:00
|
|
|
export * from './interfaces/IResourceComponent';
|
2025-11-23 14:49:37 +08:00
|
|
|
|
|
|
|
|
// Core
|
|
|
|
|
export { AssetManager } from './core/AssetManager';
|
|
|
|
|
export { AssetCache } from './core/AssetCache';
|
|
|
|
|
export { AssetDatabase } from './core/AssetDatabase';
|
|
|
|
|
export { AssetLoadQueue } from './core/AssetLoadQueue';
|
|
|
|
|
export { AssetReference, WeakAssetReference, AssetReferenceArray } from './core/AssetReference';
|
|
|
|
|
export { AssetPathResolver, globalPathResolver } from './core/AssetPathResolver';
|
|
|
|
|
export type { IAssetPathConfig } from './core/AssetPathResolver';
|
|
|
|
|
|
|
|
|
|
// Loaders
|
|
|
|
|
export { AssetLoaderFactory } from './loaders/AssetLoaderFactory';
|
|
|
|
|
export { TextureLoader } from './loaders/TextureLoader';
|
|
|
|
|
export { JsonLoader } from './loaders/JsonLoader';
|
|
|
|
|
export { TextLoader } from './loaders/TextLoader';
|
|
|
|
|
export { BinaryLoader } from './loaders/BinaryLoader';
|
|
|
|
|
|
|
|
|
|
// Integration
|
|
|
|
|
export { EngineIntegration } from './integration/EngineIntegration';
|
|
|
|
|
export type { IEngineBridge } from './integration/EngineIntegration';
|
|
|
|
|
|
2025-11-25 22:23:19 +08:00
|
|
|
// Services
|
|
|
|
|
export { SceneResourceManager } from './services/SceneResourceManager';
|
|
|
|
|
export type { IResourceLoader } from './services/SceneResourceManager';
|
|
|
|
|
|
|
|
|
|
// Utils
|
|
|
|
|
export { UVHelper } from './utils/UVHelper';
|
|
|
|
|
|
2025-11-23 14:49:37 +08:00
|
|
|
// Default instance
|
|
|
|
|
import { AssetManager } from './core/AssetManager';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Default asset manager instance
|
|
|
|
|
* 默认资产管理器实例
|
|
|
|
|
*/
|
|
|
|
|
export const assetManager = new AssetManager();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initialize asset system with catalog
|
|
|
|
|
* 使用目录初始化资产系统
|
|
|
|
|
*/
|
2025-12-03 22:15:22 +08:00
|
|
|
export function initializeAssetSystem(catalog?: IAssetCatalog): AssetManager {
|
2025-11-23 14:49:37 +08:00
|
|
|
if (catalog) {
|
|
|
|
|
return new AssetManager(catalog);
|
|
|
|
|
}
|
|
|
|
|
return assetManager;
|
|
|
|
|
}
|
2025-12-03 22:15:22 +08:00
|
|
|
|
|
|
|
|
// Re-export IAssetCatalog for initializeAssetSystem signature
|
|
|
|
|
import type { IAssetCatalog } from './types/AssetTypes';
|