System.register(["cc"], function (_export, _context) {
  "use strict";

  var _cclegacy, _decorator, Component, systemEvent, SystemEventType, v2, _dec, _class, _temp, _crd, ccclass, property, Main;

  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }

  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

  return {
    setters: [function (_cc) {
      _cclegacy = _cc.cclegacy;
      _decorator = _cc._decorator;
      Component = _cc.Component;
      systemEvent = _cc.systemEvent;
      SystemEventType = _cc.SystemEventType;
      v2 = _cc.v2;
    }],
    execute: function () {
      _crd = true;

      _cclegacy._RF.push({}, "d7039btV91L1ZMNfqT5gCHv", "main", undefined);

      ccclass = _decorator.ccclass;
      property = _decorator.property;

      _export("Main", Main = (_dec = ccclass('Main'), _dec(_class = (_temp = /*#__PURE__*/function (_Component) {
        _inheritsLoose(Main, _Component);

        function Main() {
          var _this;

          for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
            args[_key] = arguments[_key];
          }

          _this = _Component.call.apply(_Component, [this].concat(args)) || this;
          _this._acc = v2(0, 0);
          _this._direction = 0;
          return _this;
        }

        var _proto = Main.prototype;

        _proto.start = function start() {
          systemEvent.setAccelerometerEnabled(true);
          systemEvent.setAccelerometerInterval(1 / 60);
          systemEvent.on(SystemEventType.DEVICEMOTION, this._onDeviceMotion, this);
        };

        _proto.onDestory = function onDestory() {
          systemEvent.off(SystemEventType.DEVICEMOTION, this._onDeviceMotion, this);
          systemEvent.setAccelerometerEnabled(false);
        };

        _proto._onDeviceMotion = function _onDeviceMotion(event) {
          this._acc.x = event.acc.x;
          this._acc.y = event.acc.y;
          this._direction = event.acc.x < 0 ? 1 : 2;
          console.log("重力感应事件", this._acc.x, this._direction);
        };

        return Main;
      }(Component), _temp)) || _class));

      _cclegacy._RF.pop();

      _crd = false;
    }
  };
});
//# sourceMappingURL=main.js.map