1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import { Object3D, Material, Texture, AnimationClip } from 'three';
- import { AudioAsset } from '../Model/AudioAsset';
- declare type AssetConfig = {
- preload?: boolean;
- keepLoaded?: boolean;
- override?: boolean;
- };
- declare class AssetManagerClass {
- private _assets;
- private _assetConfigs;
- private _assetPaths;
- private _loadingAssets;
- get assets(): {
- [uuid: string]: Object3D<import("three").Event> | Texture | Material | AnimationClip | AudioAsset;
- };
- get assetConfigs(): {
- [uuid: string]: AssetConfig;
- };
- get assetPaths(): {
- [uuid: string]: string;
- };
- onRegisterAsset(callback: (asset: Object3D | AudioAsset | Material | Texture | AnimationClip) => void): {
- stop: () => void;
- };
- onRemoveAsset(callback: (asset: Object3D | AudioAsset | Material | Texture | AnimationClip) => void): {
- stop: () => void;
- };
- onClearAssets(callback: (asset: Object3D | AudioAsset | Material | Texture | AnimationClip) => void): {
- stop: () => void;
- };
- onSetAssetConfig(callback: (uuid: string, config: AssetConfig) => void): {
- stop: () => void;
- };
- onRemoveAssetConfig(callback: (uuid: string, config: AssetConfig) => void): {
- stop: () => void;
- };
- onLoadAssetConfigs(callback: (uuid: string, config: AssetConfig) => void): {
- stop: () => void;
- };
- onSetAssetPath(callback: (uuid: string, assetPath: string) => void): {
- stop: () => void;
- };
- onSetAssetPaths(callback: (paths: {
- [uuid: string]: string;
- }) => void): {
- stop: () => void;
- };
- onRemoveAssetPath(callback: (uuid: string, assetPath: string) => void): {
- stop: () => void;
- };
- setAssetConfig(uuid: string, config: {
- preload?: boolean;
- keepLoaded?: boolean;
- override?: boolean;
- }): void;
- getAssetConfig(uuid: string): AssetConfig;
- removeAssetConfig(uuid: string): void;
- setAssetPath(uuid: string, assetPath: string): void;
- removeAssetPath(uuid: string): void;
- setAssetPaths(paths: {
- [uuid: string]: string;
- }): void;
- getAssetPath(uuid: string): string | undefined;
- registerAsset(asset: Object3D | AudioAsset | Material | Texture | AnimationClip): void;
- loadAsset(uuid: string): Promise<Object3D<import("three").Event> | Texture | Material | AnimationClip | AudioAsset | undefined>;
- private getExtension;
- getAsset(uuid: string): Object3D<import("three").Event> | Texture | Material | AnimationClip | AudioAsset;
- private loadObject;
- private loadObjectFunction;
- private loadNestedPrefabs;
- private loadAudio;
- private loadAudioFunction;
- private loadAnimation;
- private loadAnimationFunction;
- private loadMaterial;
- private loadMaterialFunction;
- private loadTexture;
- private loadTextureFunction;
- private loadTextureFile;
- removeAsset(uuid: string): void;
- clear(): void;
- assetIsOrphan(uuid: string): boolean;
- loadAssetConfigs(configs?: {
- [uuid: string]: AssetConfig;
- }): void;
- /**
- * Load all assets set to preload if not loaded already
- */
- preloadAssets(): Promise<void>;
- }
- export declare let AssetManager: AssetManagerClass;
- export {};
|