phaser3-rex-plugins
Version:
2 lines (1 loc) • 2.07 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).rexeventpromiseplugin=e();}(undefined,(function(){function e(t){return e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},e(t)}function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function r(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function o(t){var n=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(t){return !1}}();return function(){var o,i=e(t);if(n){var u=e(this).constructor;o=Reflect.construct(i,arguments,u);}else o=i.apply(this,arguments);return r(this,o)}}var i=function(t,e){return new Promise((function(n,r){t.once(e,(function(){n();}));}))},u=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e);}(c,Phaser.Plugins.BasePlugin);var r,f=o(c);function c(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),f.call(this,t)}return r=c,Object.defineProperty(r,"prototype",{writable:!1}),r}(),f={waitEvent:i,waitComplete:function(t){return i(t,"complete")},delay:function(t,e){return void 0===t&&(t=0),new Promise((function(n,r){setTimeout((function(){n(e);}),t);}))}};return Object.assign(u.prototype,f),u}));