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
|
|
|
*/
|
|
|
|
|
|
2025-12-08 21:10:57 +08:00
|
|
|
// Service tokens (谁定义接口,谁导出 Token)
|
2025-12-13 19:44:08 +08:00
|
|
|
export {
|
|
|
|
|
AssetManagerToken,
|
|
|
|
|
PrefabServiceToken,
|
|
|
|
|
PathResolutionServiceToken,
|
|
|
|
|
type IAssetManager,
|
|
|
|
|
type IPrefabService,
|
|
|
|
|
type IPrefabAsset,
|
|
|
|
|
type IPrefabData,
|
|
|
|
|
type IPrefabMetadata,
|
|
|
|
|
type IPathResolutionService
|
|
|
|
|
} from './tokens';
|
2025-12-08 21:10:57 +08:00
|
|
|
|
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';
|
2025-12-13 19:44:08 +08:00
|
|
|
export { AssetPathResolver } from './core/AssetPathResolver';
|
2025-11-23 14:49:37 +08:00
|
|
|
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';
|
2025-12-06 14:47:35 +08:00
|
|
|
export { AudioLoader } from './loaders/AudioLoader';
|
2025-12-13 19:44:08 +08:00
|
|
|
export { PrefabLoader } from './loaders/PrefabLoader';
|
2025-11-23 14:49:37 +08:00
|
|
|
|
|
|
|
|
// Integration
|
|
|
|
|
export { EngineIntegration } from './integration/EngineIntegration';
|
2025-12-13 19:44:08 +08:00
|
|
|
export type { ITextureEngineBridge } from './integration/EngineIntegration';
|
2025-11-23 14:49:37 +08:00
|
|
|
|
2025-11-25 22:23:19 +08:00
|
|
|
// Services
|
|
|
|
|
export { SceneResourceManager } from './services/SceneResourceManager';
|
|
|
|
|
export type { IResourceLoader } from './services/SceneResourceManager';
|
2025-12-13 19:44:08 +08:00
|
|
|
export { PathResolutionService } from './services/PathResolutionService';
|
2025-11-25 22:23:19 +08:00
|
|
|
|
|
|
|
|
// Utils
|
|
|
|
|
export { UVHelper } from './utils/UVHelper';
|
2025-12-10 18:23:29 +08:00
|
|
|
export {
|
|
|
|
|
isValidGUID,
|
|
|
|
|
generateGUID,
|
|
|
|
|
hashBuffer,
|
|
|
|
|
hashString,
|
|
|
|
|
hashFileInfo
|
|
|
|
|
} from './utils/AssetUtils';
|
2025-12-13 19:44:08 +08:00
|
|
|
export {
|
|
|
|
|
collectAssetReferences,
|
|
|
|
|
extractUniqueGuids,
|
|
|
|
|
groupByComponentType,
|
|
|
|
|
DEFAULT_ASSET_PATTERNS,
|
|
|
|
|
type SceneAssetRef,
|
|
|
|
|
type AssetFieldPattern
|
|
|
|
|
} from './utils/AssetCollector';
|
2025-11-25 22:23:19 +08:00
|
|
|
|
2025-12-13 19:44:08 +08:00
|
|
|
// Re-export for initializeAssetSystem
|
2025-11-23 14:49:37 +08:00
|
|
|
import { AssetManager } from './core/AssetManager';
|
2025-12-13 19:44:08 +08:00
|
|
|
import type { IAssetCatalog } from './types/AssetTypes';
|
2025-11-23 14:49:37 +08:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Initialize asset system with catalog
|
|
|
|
|
* 使用目录初始化资产系统
|
2025-12-13 19:44:08 +08:00
|
|
|
*
|
|
|
|
|
* @param catalog 资产目录 | Asset catalog
|
|
|
|
|
* @returns 新的 AssetManager 实例 | New AssetManager instance
|
2025-11-23 14:49:37 +08:00
|
|
|
*/
|
2025-12-03 22:15:22 +08:00
|
|
|
export function initializeAssetSystem(catalog?: IAssetCatalog): AssetManager {
|
2025-12-13 19:44:08 +08:00
|
|
|
return new AssetManager(catalog);
|
2025-11-23 14:49:37 +08:00
|
|
|
}
|