1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- System.register(["cc"], function (_export, _context) {
- "use strict";
- var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, input, Input, _dec, _class, _class2, _descriptor, _crd, ccclass, property, self_plane;
- function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
- function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
- function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
- return {
- setters: [function (_cc) {
- _cclegacy = _cc.cclegacy;
- __checkObsolete__ = _cc.__checkObsolete__;
- __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__;
- _decorator = _cc._decorator;
- Component = _cc.Component;
- input = _cc.input;
- Input = _cc.Input;
- }],
- execute: function () {
- _crd = true;
- _cclegacy._RF.push({}, "aab8fR03J1HCIVTbvXr9zTq", "self-plane", undefined);
- __checkObsolete__(['_decorator', 'Component', 'Node', 'input', 'Input', 'EventTouch']);
- ({
- ccclass,
- property
- } = _decorator);
- _export("self_plane", self_plane = (_dec = ccclass('self_plane'), _dec(_class = (_class2 = class self_plane extends Component {
- constructor(...args) {
- super(...args);
- _initializerDefineProperty(this, "speed", _descriptor, this);
- }
- start() {
- // input.on(Input.EventType.TOUCH_START, this._touchStart, this);
- input.on(Input.EventType.TOUCH_MOVE, this._touchMove, this);
- } // update(deltaTime: number) {
- // }
- _touchMove(event) {
- const delta = event.getDelta();
- let pos = this.node.position; // x 上下, z 左右
- // this.node.setPosition(pos.x - 0.01 * this.speed * delta.x, pos.y, pos.z - 0.01 * this.speed * delta.y)
- this.node.setPosition(pos.x + 0.01 * this.speed * delta.y, pos.y, pos.z + 0.01 * this.speed * delta.x);
- }
- }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "speed", [property], {
- configurable: true,
- enumerable: true,
- writable: true,
- initializer: function () {
- return 1;
- }
- })), _class2)) || _class));
- _cclegacy._RF.pop();
- _crd = false;
- }
- };
- });
- //# sourceMappingURL=4f9ed18d6888522e624477ee9367504b1189be0c.js.map
|