@mai3/phaser-sdk
Version:
A UI component library based on the Phaser game engine
38 lines (37 loc) • 1.58 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import ObjectFactory from "./ObjectFactory";
var Mai3Plugin = /** @class */ (function (_super) {
__extends(Mai3Plugin, _super);
function Mai3Plugin(scene, pluginManager) {
var _this = _super.call(this, scene, pluginManager, 'mai3') || this;
_this.scene = scene;
_this.add = new ObjectFactory(scene, true);
_this.make = new ObjectFactory(scene, false);
return _this;
}
Mai3Plugin.prototype.boot = function () {
var eventEmitter = this.scene.events;
eventEmitter.once('destroy', this.destroy, this);
};
Mai3Plugin.prototype.destroy = function () {
this.add.destroy();
this.make.destroy();
_super.prototype.destroy.call(this);
};
return Mai3Plugin;
}(Phaser.Plugins.ScenePlugin));
export { Mai3Plugin };