@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
23 lines (16 loc) • 722 B
JavaScript
import { AssetLoader } from "../../../asset/loaders/AssetLoader.js";
import { GameAssetType } from "../../../asset/GameAssetType.js";
import { AttachmentSockets } from "../AttachmentSockets.js";
import { Asset } from "../../../asset/Asset.js";
export class AttachmentSocketsAssetLoader extends AssetLoader {
load(scope, path, success, failure, progress) {
this.assetManager.promise(path, GameAssetType.JSON, { scope })
.then(asset => {
const json = asset.create();
const a = new Asset(() => {
return AttachmentSockets.fromJSON(json);
}, 1);
success(a);
}, failure);
}
}