text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rexmovetoplugin=e():t.rexmovetoplugin=e()}(window,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,s){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(i.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(s,n,function(e){return t[e]}.bind(null,n));return s},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=116)}({116:function(t,e,i){"use strict";i.r(e);var s=i(57);e.default=class extends Phaser.Plugins.BasePlugin{constructor(t){super(t)}start(){this.game.events.once("destroy",this.destroy,this)}add(t,e){return new s.a(t,e)}}},2:function(t,e,i){"use strict";const s=Phaser.Scene;var n=function(t){return t instanceof s};e.a=function(t){return n(t)?t:t.scene&&n(t.scene)?t.scene:t.parent&&t.parent.scene&&n(t.parent.scene)?t.parent.scene:void 0}},57:function(t,e,i){"use strict";var s=i(6),n=i(2);const r=Phaser.Utils.Objects.GetValue,o=Phaser.Utils.Objects.IsPlainObject,a=Phaser.Math.Distance.Between,u=Phaser.Math.Linear,c=Phaser.Math.Angle.Between;var h=class extends s.a{constructor(t,e){super(t,e),this.gameObject=t,this.scene=Object(n.a)(t),this.resetFromJSON(e),this.boot()}resetFromJSON(t){return this.isRunning=r(t,"isRunning",!1),this.setEnable(r(t,"enable",!0)),this.timeScale=r(t,"timeScale",1),this.setSpeed(r(t,"speed",400)),this.setRotateToTarget(r(t,"rotateToTarget",!1)),this.targetX=r(t,"targetX",0),this.targetY=r(t,"targetY",0),this}toJSON(){return{isRunning:this.isRunning,enable:this.enable,timeScale:this.timeScale,speed:this.speed,rotateToTarget:this.rotateToTarget,targetX:this.targetX,targetY:this.targetY,tickingMode:this.tickingMode}}boot(){super.boot(),this.gameObject.on&&this.gameObject.on("destroy",this.destroy,this)}shutdown(){super.shutdown(),this.gameObject=void 0,this.scene=void 0}destroy(){this.shutdown()}startTicking(){super.startTicking(),this.scene.events.on("update",this.update,this)}stopTicking(){super.stopTicking(),this.scene.events.off("update",this.update,this)}setEnable(t){return void 0==t&&(t=!0),this.enable=t,this}setSpeed(t){return this.speed=t,this}setRotateToTarget(t){return this.rotateToTarget=t,this}moveTo(t,e,i){if(this.stop(),o(t)){var s=t;t=r(s,"x",void 0),e=r(s,"y",void 0),i=r(s,"speed",void 0)}return this.targetX=t,this.targetY=e,null==t||null==e?this:(void 0!==i&&(this.speed=i),this.isRunning=!0,this)}stop(){this.isRunning=!1}update(t,e){if(!this.isRunning||!this.enable)return this;var i=this.gameObject,s=i.x,n=i.y,r=this.targetX,o=this.targetY;if(s===r&&n===o)return this.complete(),this;if(0===this.speed||0===e||0===this.timeScale)return this;var h,g,d=e*this.timeScale/1e3,l=this.speed*d,p=a(s,n,r,o);if(l<p){var f=l/p;h=u(s,r,f),g=u(n,o,f)}else h=r,g=o;return i.setPosition(h,g),this.rotateToTarget&&(i.rotation=c(s,n,h,g)),this}};e.a=h},6:function(t,e,i){"use strict";const s=Phaser.Events.EventEmitter,n=Phaser.Utils.Objects.GetValue;const r={no:0,lazy:1,always:2};e.a=class extends s{constructor(t,e){super(),this._isRunning=!1,this.tickingState=!1,this.setTickingMode(n(e,"tickingMode",1))}boot(){2!==this.tickingMode||this.tickingState||this.startTicking()}shutdown(){super.shutdown(),this.tickingState&&this.stopTicking()}setTickingMode(t){"string"==typeof t&&(t=r[t]),this.tickingMode=t}startTicking(){this.tickingState=!0}stopTicking(){this.tickingState=!1}get isRunning(){return this._isRunning}set isRunning(t){this._isRunning!==t&&(this._isRunning=t,1===this.tickingMode&&t!=this.tickingState&&(t?this.startTicking():this.stopTicking()))}complete(){this.isRunning=!1,this.emit("complete",this,this.gameObject)}}}}).default});