System.register(["cc"], function (_export, _context) { "use strict"; var _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, Component, Label, RigidBody, _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3, _crd, ccclass, property, Cube_State, Cube_Infor; 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; Label = _cc.Label; RigidBody = _cc.RigidBody; }], execute: function () { _crd = true; _cclegacy._RF.push({}, "0fe67dkVupFZYUR3uRu1sAy", "Cube_Infor", undefined); __checkObsolete__(['_decorator', 'Component', 'Label', 'Node', 'RigidBody']); ({ ccclass, property } = _decorator); _export("Cube_State", Cube_State = /*#__PURE__*/function (Cube_State) { Cube_State[Cube_State["live"] = 0] = "live"; Cube_State[Cube_State["wait"] = 1] = "wait"; Cube_State[Cube_State["dead"] = 2] = "dead"; return Cube_State; }({})); _export("Cube_Infor", Cube_Infor = (_dec = ccclass('Cube_Infor'), _dec2 = property(Label), _dec3 = property(Label), _dec4 = property(RigidBody), _dec(_class = (_class2 = class Cube_Infor extends Component { constructor() { super(...arguments); _initializerDefineProperty(this, "txt", _descriptor, this); _initializerDefineProperty(this, "txt2", _descriptor2, this); _initializerDefineProperty(this, "rigidbody", _descriptor3, this); this.text = void 0; this.state = Cube_State.live; // 添加缓存状态来避免重复切换 this.isUp = false; } start() {} update(deltaTime) { // 获取方块当前的旋转角度(以欧拉角形式) var rotationX = this.node.eulerAngles.x; if (rotationX >= -160 && rotationX < -30) { this.ShowFront(); // 显示正面字 } else if (rotationX > 30 && rotationX <= 160) { this.ShowBack(); // 显示反面字 } else { this.ShowBothSides(); } } ShowFront() { this.txt.node.active = true; this.txt2.node.active = false; } ShowBack() { this.txt.node.active = false; this.txt2.node.active = true; } ShowBothSides() { this.txt.node.active = true; this.txt2.node.active = true; } set Text(value) { this.txt.string = value; this.txt2.string = value; } get Text() { return this.txt.string; } }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "txt", [_dec2], { configurable: true, enumerable: true, writable: true, initializer: null }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "txt2", [_dec3], { configurable: true, enumerable: true, writable: true, initializer: null }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "rigidbody", [_dec4], { configurable: true, enumerable: true, writable: true, initializer: null })), _class2)) || _class)); _cclegacy._RF.pop(); _crd = false; } }; }); //# sourceMappingURL=07873864f2752ebebcdaae9cbb27e5477e565642.js.map