System.register(["__unresolved_0", "cc", "__unresolved_1", "__unresolved_2", "__unresolved_3", "__unresolved_4", "__unresolved_5", "__unresolved_6", "__unresolved_7", "__unresolved_8", "__unresolved_9", "__unresolved_10", "__unresolved_11", "__unresolved_12", "__unresolved_13", "__unresolved_14", "__unresolved_15"], function (_export, _context) { "use strict"; var _reporterNs, _cclegacy, __checkObsolete__, __checkObsoleteInNamespace__, _decorator, BoxCollider, Component, director, instantiate, Node, NodePool, Prefab, Quat, RigidBody, tween, Vec3, ch_util, gui, UI_Main, CreateIdiom, Cube_Infor, Cube_State, GameCtl, ch, table_idiom_order, table_idiom_unorder_1_3, table_idiom_unorder_2_2, table_idiom_unorder_3_1, table_level, table_level_2, GameState, Hall, UI_Idioms, _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _crd, ccclass, property, Container_Manager; 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.'); } function _reportPossibleCrUseOfch_util(extras) { _reporterNs.report("ch_util", "../../ch/ch_util", _context.meta, extras); } function _reportPossibleCrUseOfgui(extras) { _reporterNs.report("gui", "../../core/ui/ui", _context.meta, extras); } function _reportPossibleCrUseOfLayout_Main(extras) { _reporterNs.report("Layout_Main", "../ui/UI_Main/Layout_Main", _context.meta, extras); } function _reportPossibleCrUseOfUI_Main(extras) { _reporterNs.report("UI_Main", "../ui/UI_Main/UI_Main", _context.meta, extras); } function _reportPossibleCrUseOfCreateIdiom(extras) { _reporterNs.report("CreateIdiom", "./CreateIdiom", _context.meta, extras); } function _reportPossibleCrUseOfCube_Infor(extras) { _reporterNs.report("Cube_Infor", "./Cube_Infor", _context.meta, extras); } function _reportPossibleCrUseOfCube_State(extras) { _reporterNs.report("Cube_State", "./Cube_Infor", _context.meta, extras); } function _reportPossibleCrUseOfGameCtl(extras) { _reporterNs.report("GameCtl", "./GameCtl", _context.meta, extras); } function _reportPossibleCrUseOfch(extras) { _reporterNs.report("ch", "../../ch/ch", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_order(extras) { _reporterNs.report("table_idiom_order", "../../module_extra/table_ts/table_idiom_order", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_unorder_1_(extras) { _reporterNs.report("table_idiom_unorder_1_3", "../../module_extra/table_ts/table_idiom_unorder_1_3", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_unorder_2_(extras) { _reporterNs.report("table_idiom_unorder_2_2", "../../module_extra/table_ts/table_idiom_unorder_2_2", _context.meta, extras); } function _reportPossibleCrUseOftable_idiom_unorder_3_(extras) { _reporterNs.report("table_idiom_unorder_3_1", "../../module_extra/table_ts/table_idiom_unorder_3_1", _context.meta, extras); } function _reportPossibleCrUseOftable_level(extras) { _reporterNs.report("table_level", "../../module_extra/table_ts/table_level", _context.meta, extras); } function _reportPossibleCrUseOftable_level_(extras) { _reporterNs.report("table_level_2", "../../module_extra/table_ts/table_level_2", _context.meta, extras); } function _reportPossibleCrUseOfGameState(extras) { _reporterNs.report("GameState", "../hall/Hall", _context.meta, extras); } function _reportPossibleCrUseOfHall(extras) { _reporterNs.report("Hall", "../hall/Hall", _context.meta, extras); } function _reportPossibleCrUseOfUI_Idioms(extras) { _reporterNs.report("UI_Idioms", "../ui/UI_Idioms/UI_Idioms", _context.meta, extras); } return { setters: [function (_unresolved_) { _reporterNs = _unresolved_; }, function (_cc) { _cclegacy = _cc.cclegacy; __checkObsolete__ = _cc.__checkObsolete__; __checkObsoleteInNamespace__ = _cc.__checkObsoleteInNamespace__; _decorator = _cc._decorator; BoxCollider = _cc.BoxCollider; Component = _cc.Component; director = _cc.director; instantiate = _cc.instantiate; Node = _cc.Node; NodePool = _cc.NodePool; Prefab = _cc.Prefab; Quat = _cc.Quat; RigidBody = _cc.RigidBody; tween = _cc.tween; Vec3 = _cc.Vec3; }, function (_unresolved_2) { ch_util = _unresolved_2.default; }, function (_unresolved_3) { gui = _unresolved_3.gui; }, function (_unresolved_4) { UI_Main = _unresolved_4.UI_Main; }, function (_unresolved_5) { CreateIdiom = _unresolved_5.CreateIdiom; }, function (_unresolved_6) { Cube_Infor = _unresolved_6.Cube_Infor; Cube_State = _unresolved_6.Cube_State; }, function (_unresolved_7) { GameCtl = _unresolved_7.GameCtl; }, function (_unresolved_8) { ch = _unresolved_8.ch; }, function (_unresolved_9) { table_idiom_order = _unresolved_9.table_idiom_order; }, function (_unresolved_10) { table_idiom_unorder_1_3 = _unresolved_10.table_idiom_unorder_1_3; }, function (_unresolved_11) { table_idiom_unorder_2_2 = _unresolved_11.table_idiom_unorder_2_2; }, function (_unresolved_12) { table_idiom_unorder_3_1 = _unresolved_12.table_idiom_unorder_3_1; }, function (_unresolved_13) { table_level = _unresolved_13.table_level; }, function (_unresolved_14) { table_level_2 = _unresolved_14.table_level_2; }, function (_unresolved_15) { GameState = _unresolved_15.GameState; Hall = _unresolved_15.Hall; }, function (_unresolved_16) { UI_Idioms = _unresolved_16.UI_Idioms; }], execute: function () { _crd = true; _cclegacy._RF.push({}, "e84de8IXbZDjZbYlbQpevuI", "Container_Manager", undefined); __checkObsolete__(['_decorator', 'BoxCollider', 'Component', 'director', 'find', 'instantiate', 'Node', 'NodePool', 'Prefab', 'Quat', 'random', 'RigidBody', 'sp', 'tween', 'Vec3']); ({ ccclass, property } = _decorator); _export("Container_Manager", Container_Manager = (_dec = ccclass('Container_Manager'), _dec2 = property(Node), _dec3 = property(Node), _dec4 = property([Node]), _dec5 = property([Prefab]), _dec6 = property(_crd && CreateIdiom === void 0 ? (_reportPossibleCrUseOfCreateIdiom({ error: Error() }), CreateIdiom) : CreateIdiom), _dec7 = property([Node]), _dec(_class = (_class2 = class Container_Manager extends Component { constructor(...args) { super(...args); _initializerDefineProperty(this, "skeleton1", _descriptor, this); _initializerDefineProperty(this, "skeleton2", _descriptor2, this); this.canTouch = false; _initializerDefineProperty(this, "Lock_node", _descriptor3, this); _initializerDefineProperty(this, "prefabs", _descriptor4, this); this.level_config = null; //关卡配置 this.level2_config = null; //第二关配置 this.config = null; //有规律的成语库 this.config_1_3 = null; //无规律1+3 this.config_2_2 = null; //无规律2+2 this.config_3_1 = null; //无规律3+1 this.idioms = []; //生成的成语 this.idioms_Copy = []; //生成的成语备份 this.index = 0; _initializerDefineProperty(this, "create_node", _descriptor5, this); _initializerDefineProperty(this, "nodes", _descriptor6, this); //位置节点 用于成语放入 this.node_isIdiom = new Array(9).fill(false); this.unlock_Num = 7; this.is_Show_UI_Lock = false; this.idiom_combine = new Map(); this.Cube_Pool = new NodePool(); this.nodeReferences = []; // 额外维护的节点引用数组 this.count = 0; this.time = 0; } instantiateCube() { let num = 60; if (this.idioms.length < 30) { num = this.idioms.length * 2; } for (let i = 0; i < num; i++) { let idiomIndex = Math.floor(i / 2); let isPiece1 = i % 2 === 0; let Text_Length = isPiece1 ? this.idioms[idiomIndex].piece_1_word.length : this.idioms[idiomIndex].piece_2_word.length; const newCube = instantiate(this.prefabs[Text_Length - 1]); newCube.active = true; // 按顺序为节点赋值文字内容 newCube.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text = isPiece1 ? this.idioms[idiomIndex].piece_1_word : this.idioms[idiomIndex].piece_2_word; // console.log("生成第" + i + "个节点:" + newCube.getComponent(Cube_Infor).Text); this.Cube_Pool.put(newCube); } this.index = num; if ((_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({ error: Error() }), Hall) : Hall).getInstance().player.get_max_floor() != 0) this.shufflePool(); } instantiateNewCube() { console.log("instantiateNewCube"); if (this.index < this.count * 2) { console.log("idiomIndex:" + Math.floor(this.index / 2)); let idiomIndex = Math.floor(this.index / 2); let isPiece1 = this.index % 2 === 0; let Text_Length = isPiece1 ? this.idioms_Copy[idiomIndex].piece_1_word.length : this.idioms_Copy[idiomIndex].piece_2_word.length; const newCube = instantiate(this.prefabs[Text_Length - 1]); newCube.active = true; // 按顺序为节点赋值文字内容 newCube.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text = isPiece1 ? this.idioms_Copy[idiomIndex].piece_1_word : this.idioms_Copy[idiomIndex].piece_2_word; //随机选择已在nodereference中的一个方块position newCube.parent = director.getScene(); newCube.setPosition(this.nodeReferences[Math.floor(Math.random() * this.nodeReferences.length)].position.x, this.nodeReferences[Math.floor(Math.random() * this.nodeReferences.length)].position.y - 0.1, this.nodeReferences[Math.floor(Math.random() * this.nodeReferences.length)].position.z); this.nodeReferences.push(newCube); console.log("生成第" + this.index + "个节点:" + newCube.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text); console.log("位置:" + newCube.position); this.index = this.index + 1; } } getCube() { // console.log(this.Cube_Pool.size()); const cube = this.Cube_Pool.get(); if (cube) cube.active = true; return cube; } // 将方块回收到对象池 recycleCube(cube) { cube.active = false; // 将方块设置为非激活状态 this.Cube_Pool.put(cube); } //清空对象池 clearCubePool() { this.Cube_Pool.clear(); } //合成规则导入 start() { this.config = (_crd && table_idiom_order === void 0 ? (_reportPossibleCrUseOftable_idiom_order({ error: Error() }), table_idiom_order) : table_idiom_order).getList(); this.config_1_3 = (_crd && table_idiom_unorder_1_3 === void 0 ? (_reportPossibleCrUseOftable_idiom_unorder_1_({ error: Error() }), table_idiom_unorder_1_3) : table_idiom_unorder_1_3).getList(); this.config_2_2 = (_crd && table_idiom_unorder_2_2 === void 0 ? (_reportPossibleCrUseOftable_idiom_unorder_2_({ error: Error() }), table_idiom_unorder_2_2) : table_idiom_unorder_2_2).getList(); this.config_3_1 = (_crd && table_idiom_unorder_3_1 === void 0 ? (_reportPossibleCrUseOftable_idiom_unorder_3_({ error: Error() }), table_idiom_unorder_3_1) : table_idiom_unorder_3_1).getList(); console.log(this.config.length); console.log(this.config_1_3.length); console.log(this.config_2_2.length); console.log(this.config_3_1.length); this.level_config = (_crd && table_level === void 0 ? (_reportPossibleCrUseOftable_level({ error: Error() }), table_level) : table_level).getList(); this.level2_config = (_crd && table_level_2 === void 0 ? (_reportPossibleCrUseOftable_level_({ error: Error() }), table_level_2) : table_level_2).getList(); // if (this.level_config.length === 5) { // console.log("关卡配置导入成功"); // } this.level_idioms(); } update(deltaTime) {} checkIdiom_Combine(matchedcube2, outMatchedCubes) { if (this.idiom_combine.size < 2) { return false; // 至少需要两个方块 } for (let cube of this.idiom_combine.keys()) { // 遍历 idioms 列表,检查是否匹配成语 const matchedIdiom = this.idioms.find(idiom => idiom.piece_1_word === cube.Text && idiom.piece_2_word === matchedcube2.Text); if (matchedIdiom) { // 匹配成功 outMatchedCubes.push(cube, matchedcube2); this.nodeReferences = this.nodeReferences.filter(el => el !== matchedcube2.node && el !== cube.node); console.log("成功拼成成语: " + matchedIdiom.piece_1_word + matchedIdiom.piece_2_word); return true; } // 再检查逆序组合是否匹配 const reverseMatchedIdiom = this.idioms.find(idiom => idiom.piece_1_word === matchedcube2.Text && idiom.piece_2_word === cube.Text); if (reverseMatchedIdiom) { // 匹配成功 outMatchedCubes.push(matchedcube2, cube); this.nodeReferences = this.nodeReferences.filter(el => el !== matchedcube2.node && el !== cube.node); console.log("成功拼成成语: " + reverseMatchedIdiom.piece_1_word + reverseMatchedIdiom.piece_2_word); return true; } } return false; // 没有匹配到成语 } async level_idioms() { this.Lock_node.forEach(node => node.active = true); this.unlock_Num = 7; this.is_Show_UI_Lock = false; this.canTouch = false; this.index = 0; let level = (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({ error: Error() }), Hall) : Hall).getInstance().player.get_max_floor(); (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({ error: Error() }), Hall) : Hall).getInstance().gameState = (_crd && GameState === void 0 ? (_reportPossibleCrUseOfGameState({ error: Error() }), GameState) : GameState).gameing; if (level > 0) { (_crd && Hall === void 0 ? (_reportPossibleCrUseOfHall({ error: Error() }), Hall) : Hall).getInstance().firstEnter = false; } this.clearLevelData(); this.idioms = []; this.node_isIdiom = new Array(9).fill(false); this.idiom_combine = new Map(); // 获取当前关卡的成语配置 if (level === 0) { this.setupLevel1(); } else if (level === 1) { this.setupLevel2(); } else { this.setupLevelDefault(level); } this.idioms_Copy = [...this.idioms]; this.count = this.level_config[level].total; this.time = this.level_config[level].time; await this.instantiateCube(); await (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).show(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({ error: Error() }), UI_Idioms) : UI_Idioms); this.create_node.nodeMoving(); (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).show(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({ error: Error() }), UI_Main) : UI_Main); } clearLevelData() { for (let node of this.nodeReferences) { node.destroy(); } this.nodeReferences = []; this.clearCubePool(); } setupLevel1() { const idiom_type_2 = this.level_config[0].idiom_type_2.split("_"); console.log("idiom_type_2:", idiom_type_2); idiom_type_2.forEach(rule => { const filteredIdioms = this.config.filter(item => item.piece_2_word === rule); console.log(`筛选2 ${rule} 后的成语:`, filteredIdioms); this.idioms.push(...filteredIdioms); }); console.log("最终选中的成语:", this.idioms); } setupLevel2() { for (let i = 0; i < 30; i++) { this.idioms.push(...this.filterIdioms(this.level2_config[i].idiom, this.config)); this.idioms.push(...this.filterIdioms(this.level2_config[i].idiom, this.config_3_1)); } for (let i = 30; i < 40; i++) { this.idioms.push(...this.filterIdioms(this.level2_config[i].idiom, this.config_2_2)); } console.log("最终选中的成语:", this.idioms); } setupLevelDefault(level) { const dif = this.level_config[level].different_grade_level.split("_"); const grade = dif[0]; const idiom_type_1 = this.parseIdiomType(this.level_config[level].idiom_type_1); const idiom_type_2 = this.parseIdiomType(this.level_config[level].idiom_type_2); const count = this.level_config[level].count / (idiom_type_1.length + idiom_type_2.length); console.log("count:", count); let selectedIdioms = {}; // 筛选成语并随机选择 this.selectIdiomsByRules(idiom_type_1, grade, count, selectedIdioms, 'piece_1_word'); this.selectIdiomsByRules(idiom_type_2, grade, count, selectedIdioms, 'piece_2_word'); // 合并结果 // 使用 Object.keys 来遍历 selectedIdioms for (let rule in selectedIdioms) { this.idioms.push(...selectedIdioms[rule]); } // 随机选择难度成语 this.selectIdiomsByDifficulty(level, 'easy_1_3', this.config_1_3); this.selectIdiomsByDifficulty(level, 'hard_1_3', this.config_1_3); this.selectIdiomsByDifficulty(level, 'easy_2_2', this.config_2_2); this.selectIdiomsByDifficulty(level, 'hard_2_2', this.config_2_2); this.selectIdiomsByDifficulty(level, 'easy_3_1', this.config_3_1); this.selectIdiomsByDifficulty(level, 'hard_3_1', this.config_3_1); console.log("最终选中的成语:", this.idioms); } parseIdiomType(idiomType) { return idiomType.split("_").filter(item => item !== ""); } selectIdiomsByRules(idiomType, grade, count, selectedIdioms, ruleKey) { idiomType.forEach(rule => { const filteredIdioms = this.config.filter(item => item[ruleKey] === rule && item.difficulty === grade); console.log(`筛选 ${rule} 后的成语:`, filteredIdioms); if (filteredIdioms.length < count) { console.error(`规律 ${rule} 的成语数量不足,仅有 ${filteredIdioms.length} 个`); } else { const selected = this.randomSelectIdioms(filteredIdioms, count); selectedIdioms[rule] = selected; } }); } randomSelectIdioms(filteredIdioms, count) { let selected = []; for (let i = 0; i < count; i++) { const rand = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, filteredIdioms.length - 1); selected.push(filteredIdioms.splice(rand, 1)[0]); } return selected; } selectIdiomsByDifficulty(level, configKey, config) { if (this.level_config[level][configKey] > 0) { const filteredIdioms = config.filter(item => item.difficulty === "easy"); for (let i = 0; i < this.level_config[level][configKey]; i++) { const rand = (_crd && ch_util === void 0 ? (_reportPossibleCrUseOfch_util({ error: Error() }), ch_util) : ch_util).getRandomInt(0, filteredIdioms.length - 1); const selectedIdiom = filteredIdioms.splice(rand, 1)[0]; this.idioms.push(selectedIdiom); } } } filterIdioms(idiom, config) { return config.filter(item => item.idiom === idiom); } // 精简后的消除一组函数 eliminate() { var _find; // 获取槽中的方块 let cube = (_find = [...this.idiom_combine].find(([key, value]) => value === 0)) == null ? void 0 : _find[0]; // 如果槽中有方块 if (cube) { const originalReferences = [...this.nodeReferences]; for (const element of originalReferences) { const elementCubeInfo = element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor); const elementText = elementCubeInfo.Text; const cubeText = cube.Text; if (this.idioms.some(c => c.idiom === elementText + cubeText) && elementCubeInfo !== cube) { // 执行消除操作 this.processElimination(element, cube); break; } else if (this.idioms.some(c => c.idiom === cubeText + elementText) && elementCubeInfo !== cube) { this.processElimination(cube, element); break; } } } else { let flag = false; const originalReferences = [...this.nodeReferences]; for (const element1 of originalReferences) { for (const element2 of originalReferences) { const element1Text = element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text; const element2Text = element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).Text; if (this.idioms.some(c => c.idiom === element1Text + element2Text)) { // 执行消除操作 this.processElimination(element1, element2); flag = true; break; } else if (this.idioms.some(c => c.idiom === element2Text + element1Text)) { // 执行消除操作 this.processElimination(element2, element1); flag = true; break; } if (flag) { break; } } if (flag) { for (let i = 0; i < 2; i++) this.instantiateNewCube(); break; } } if (!flag) { console.log("没有可消除"); } } } // 消除操作 processElimination(element1, element2) { this.nodeReferences = this.nodeReferences.filter(el => el !== element1 && el !== element2); const element1CubeInfo = element1.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor); const element2CubeInfo = element2.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor); [element1, element2].forEach(element => { element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).wait; element.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor).rigidbody.type = RigidBody.Type.STATIC; element.getComponent(BoxCollider).enabled = false; let targetRotation = new Quat(); Quat.fromEuler(targetRotation, -90, 0, 0); element.rotation = targetRotation; }); // 执行动画 (_crd && GameCtl === void 0 ? (_reportPossibleCrUseOfGameCtl({ error: Error() }), GameCtl) : GameCtl).instance.combine_ani(element1CubeInfo, element2CubeInfo); } async shuffle() { // 回收所有非槽内的活跃节点 this.nodeReferences.forEach(node => { const cubeInfo = node.getComponent(_crd && Cube_Infor === void 0 ? (_reportPossibleCrUseOfCube_Infor({ error: Error() }), Cube_Infor) : Cube_Infor); if (cubeInfo.state === (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).live) { let targetRotation = new Quat(); Quat.fromEuler(targetRotation, -90, 0, 0); node.rotation = targetRotation; this.recycleCube(node); // 回收到池中 } }); this.shufflePool(); // 等待节点移动完成后执行后续逻辑 this.create_node.nodeMoving(); } //清空槽子 Empty() { for (let idiom of this.idiom_combine.keys()) { idiom.state = (_crd && Cube_State === void 0 ? (_reportPossibleCrUseOfCube_State({ error: Error() }), Cube_State) : Cube_State).live; let posX = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({ error: Error() }), ch) : ch).util.getRandom(-3, 3); let posZ = (_crd && ch === void 0 ? (_reportPossibleCrUseOfch({ error: Error() }), ch) : ch).util.getRandom(-3, 3); tween(idiom.node).to(0.2, { position: new Vec3(posX, this.create_node.node.position.y + 5, posZ) }).call(() => { idiom.rigidbody.type = RigidBody.Type.DYNAMIC; }).start(); //idiom.node.position = ; } this.idiom_combine.clear(); this.node_isIdiom.fill(false); (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).get(_crd && UI_Idioms === void 0 ? (_reportPossibleCrUseOfUI_Idioms({ error: Error() }), UI_Idioms) : UI_Idioms).all_light_Hide(); } AddTime() { const layout = (_crd && gui === void 0 ? (_reportPossibleCrUseOfgui({ error: Error() }), gui) : gui).get(_crd && UI_Main === void 0 ? (_reportPossibleCrUseOfUI_Main({ error: Error() }), UI_Main) : UI_Main).getLayout(); layout.time += 120; } shufflePool() { const poolSize = this.Cube_Pool.size(); const tempArray = []; // 从池中取出所有节点到临时数组 for (let i = 0; i < poolSize; i++) { tempArray.push(this.Cube_Pool.get()); } // 只打乱部分节点(以 30% 为例,可调整比例) const shuffleCount = Math.ceil(poolSize * 0.3); // 只打乱前 30% for (let i = 0; i < shuffleCount; i++) { const randomIndex = Math.floor(Math.random() * poolSize); [tempArray[i], tempArray[randomIndex]] = [tempArray[randomIndex], tempArray[i]]; } // 将打乱的节点放回池中 tempArray.forEach(cube => this.Cube_Pool.put(cube)); } }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "skeleton1", [_dec2], { configurable: true, enumerable: true, writable: true, initializer: function () { return null; } }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "skeleton2", [_dec3], { configurable: true, enumerable: true, writable: true, initializer: function () { return null; } }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "Lock_node", [_dec4], { configurable: true, enumerable: true, writable: true, initializer: function () { return []; } }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "prefabs", [_dec5], { configurable: true, enumerable: true, writable: true, initializer: function () { return []; } }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "create_node", [_dec6], { configurable: true, enumerable: true, writable: true, initializer: function () { return null; } }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "nodes", [_dec7], { configurable: true, enumerable: true, writable: true, initializer: function () { return []; } })), _class2)) || _class)); _cclegacy._RF.pop(); _crd = false; } }; }); //# sourceMappingURL=2e039fa4b8022b796ea0e92974ad9f4b5f4ac4f5.js.map