phaser4-rex-plugins
Version:
2 lines (1 loc) • 933 B
JavaScript
var e,t;e=void 0,t=function(){const e=Phaser.Physics.Arcade.Components;var t={};Object.assign(t,e.Acceleration,e.Angular,e.Bounce,e.Debug,e.Drag,e.Enable,e.Friction,e.Gravity,e.Immovable,e.Mass,e.Size,e.Velocity);var s=function(e,s){return e.body||(void 0===s&&(s=!1),e.scene.physics.add.existing(e,s)),Object.assign(e,t),e};class n extends Phaser.Plugins.BasePlugin{constructor(e){super(e)}start(){this.game.events.on("destroy",this.destroy,this)}build(e,t){return function(e,t){if(Array.isArray(e))for(var n=e,i=0,o=n.length;i<o;i++)s(n[i],t);else s(e,t);return e}(e,t)}injectMethods(e){return Object.assign(e,t),e}injectMethodsToRootClass(){return this.injectMethods(Phaser.GameObjects.GameObject.prototype),this}}return n},"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();