UNPKG

phaser3-rex-plugins

Version:
2 lines (1 loc) 2.79 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).rexbuildarcadeobjectplugin=t();}(undefined,(function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(o=n.key,i=void 0,"symbol"==typeof(i=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===t?String:Number)(e)}(o,"string"))?i:String(i)),n);}var o,i;}function t(e){return t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},t(e)}function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}function n(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function o(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return !1;if(Reflect.construct.sham)return !1;if("function"==typeof Proxy)return !0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return !1}}();return function(){var o,i=t(e);if(r){var u=t(this).constructor;o=Reflect.construct(i,arguments,u);}else o=i.apply(this,arguments);return n(this,o)}}var i=Phaser.Physics.Arcade.Components,u=function(e,t){return e.body||(void 0===t&&(t=!1),e.scene.physics.add.existing(e,t)),Object.assign(e,i.Acceleration,i.Angular,i.Bounce,i.Debug,i.Drag,i.Enable,i.Friction,i.Gravity,i.Immovable,i.Mass,i.Size,i.Velocity),e};return function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t);}(a,Phaser.Plugins.BasePlugin);var n,i,f=o(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),f.call(this,e)}return n=a,(i=[{key:"start",value:function(){this.game.events.on("destroy",this.destroy,this);}},{key:"build",value:function(e,t){return function(e,t){if(Array.isArray(e))for(var r=e,n=0,o=r.length;n<o;n++)u(r[n],t);else u(e,t);return e}(e,t)}}])&&e(n.prototype,i),Object.defineProperty(n,"prototype",{writable:!1}),a}()}));