UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

33 lines (27 loc) 1.1 kB
import { AssetLoader } from "../../../../../../../asset/loaders/AssetLoader.js"; import { GameAssetType } from "../../../../../../../asset/GameAssetType.js"; import { Asset } from "../../../../../../../asset/Asset.js"; import { readAnimationGraphDefinitionFromJSON } from "./readAnimationGraphDefinitionFromJSON.js"; export class AnimationGraphDefinitionAssetLoader extends AssetLoader { load(scope, path, success, failure, progress) { this.assetManager.get( { scope: scope, path: path, type: GameAssetType.JSON, callback: jsonAsset => { const json = jsonAsset.create(); const asset = new Asset( () => { return readAnimationGraphDefinitionFromJSON(json); }, 1 ); success(asset); }, failure: failure, progress: progress } ); } }