index.js 2.6 KB

12345678910111213141516171819202122
  1. System.register("chunks:///_virtual/Script.ts",["cc"],(function(e){"use strict";var t,n,o,c,r,s,i,a,u;return{setters:[function(e){t=e.cclegacy,n=e._decorator,o=e.systemEvent,c=e.SystemEventType,r=e.math,s=e.quat,i=e.Quat,a=e.v3,u=e.Component}],execute:function(){var l;function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}t._RF.push({},"26f1eHzlqZGBI7Mg191nzLy","Script",void 0);var d=n.ccclass;n.property,e("Script",d("Script")(l=function(e){var t,n;function u(){for(var t,n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];return p(h(t=e.call.apply(e,[this].concat(o))||this),"touches",[]),p(h(t),"scaleLen",0),p(h(t),"nodeScale",a()),p(h(t),"sensitivity",.1),t}n=e,(t=u).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var l=u.prototype;return l.onLoad=function(){var e=this;this.nodeScale=this.node.getScale(this.nodeScale),o.on(c.TOUCH_START,(function(t){if(e.touches.push(t),2==e.touches.length)return e.scaleLen=r.Vec2.distance(e.touches[0].getLocation(),e.touches[1].getLocation()),void console.log(e.scaleLen)})),o.on(c.TOUCH_MOVE,(function(t,n){if(1==e.touches.length){var o=r.clamp(e.node.eulerAngles.x+n.getDeltaY()*e.sensitivity,-15,70),c=e.node.eulerAngles.y+n.getDeltaX()*e.sensitivity,a=s();return i.fromEuler(a,o,c,0),void e.node.setRotation(a)}if(2==e.touches.length){var u=e.scaleLen;return e.scaleLen=r.Vec2.distance(e.touches[0].getLocation(),e.touches[1].getLocation()),e.nodeScale.z=r.clamp(e.nodeScale.z+(e.scaleLen-u)/300,1,3),console.log(e.nodeScale.z),void e.node.setScale(e.nodeScale)}})),o.on(c.TOUCH_END,(function(t){for(var n=e.touches.length-1;n>=0;n--)e.touches[n]==t&&e.touches.splice(n,1)})),o.on(c.TOUCH_CANCEL,(function(t){for(var n=e.touches.length-1;n>=0;n--)e.touches[n]==t&&e.touches.splice(n,1)}))},l.update=function(){},u}(u))||l);t._RF.pop()}}}));
  2. System.register("chunks:///_virtual/main",["./Script.ts"],(function(){"use strict";return{setters:[function(){}],execute:function(){}}}));
  3. (function(r) {
  4. r('virtual:///prerequisite-imports/main', 'chunks:///_virtual/main');
  5. })(function(mid, cid) {
  6. System.register(mid, [cid], function (_export, _context) {
  7. return {
  8. setters: [function(_m) {
  9. var _exportObj = {};
  10. for (var _key in _m) {
  11. if (_key !== "default" && _key !== "__esModule") _exportObj[_key] = _m[_key];
  12. }
  13. _export(_exportObj);
  14. }],
  15. execute: function () { }
  16. };
  17. });
  18. });