From 9fbe2d6d389a449116274ea30868ec48d6242b78 Mon Sep 17 00:00:00 2001 From: "YZ\\249929363" <249929363@qq.com> Date: Fri, 25 Jul 2025 10:35:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Script/Block.ts | 26 ++++++++++++++------------ assets/Script/Map.ts | 5 +++++ assets/Script/Sdk/MiniGameSdk.ts | 5 +++++ assets/shop/script/shop.ts | 3 +++ 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/assets/Script/Block.ts b/assets/Script/Block.ts index aadb8a7..d9dda78 100644 --- a/assets/Script/Block.ts +++ b/assets/Script/Block.ts @@ -431,7 +431,7 @@ export default class Block extends cc.Component { } //方块落点 - blockFall(point) { + blockFall(point, type) { if (this.over == true) return; // // 假设 MapConroler 有网格信息,这里简单示例 const mapWidth = MapConroler._instance.mapWidth; @@ -481,7 +481,7 @@ export default class Block extends cc.Component { MapConroler._instance.changeState(); this.removeBoxCollider(); this.removeMapBlock(); - this.removeAction(jg); + this.removeAction(jg, type); } else { MapConroler._instance.upDoor(this.color); @@ -498,7 +498,7 @@ export default class Block extends cc.Component { } } - removeAction(diraction) { + removeAction(diraction, type) { this.node.off(cc.Node.EventType.TOUCH_START); this.node.off(cc.Node.EventType.TOUCH_MOVE); this.node.off(cc.Node.EventType.TOUCH_CANCEL); @@ -603,7 +603,9 @@ export default class Block extends cc.Component { MapConroler._instance.nextLevel(); this.node.active = false; this.node.removeFromParent(); - + if (type == true && MapConroler._instance.openWall.length > 0) { + MapConroler._instance.predict_End(); + } // this.node.active = false; // this.node.removeFromParent(); }, time * 1000); @@ -694,11 +696,11 @@ export default class Block extends cc.Component { let local = cc.v2(this.node.x - 50, this.node.y + 50); if (this.type != 10) { //@ts-ignore - this.blockFall(local); + this.blockFall(local, true); if (this.type == 9) { if (this.block_Info.node) { let localTemp = cc.v2(this.block_Info.node.x - 50, this.block_Info.node.y + 50); - this.block_Info.node.getComponent("Block").blockFall(localTemp); + this.block_Info.node.getComponent("Block").blockFall(localTemp, false); } } } @@ -815,8 +817,8 @@ export default class Block extends cc.Component { }, 1200); } if (MapConroler._instance.ismagic) { - this.scheduleCallback = setTimeout(() => { - // 记录添加magic时的锚点 + this.scheduleCallback = setTimeout(() => { + // 记录添加magic时的锚点 this.node.anchorX = 0.5; this.node.anchorY = 0.5; this.node.addChild(new cc.Node("magic")); @@ -876,7 +878,7 @@ export default class Block extends cc.Component { // this.scheduleCallback = setTimeout(() => { // function () // }, timeout); { - + // }; // this.stopTimeCutDown(); // this.schedule(this.scheduleCallback, 0.6); @@ -901,7 +903,7 @@ export default class Block extends cc.Component { tim = time2 } if (MapConroler._instance.hammer == true) MapConroler._instance.hammer = false; - this.scheduleCallback2= setTimeout(() => { + this.scheduleCallback2 = setTimeout(() => { //如果方块可以消除 MapConroler._instance.blockNum -= 1; MapConroler._instance.special_Treatment(this.node); @@ -936,10 +938,10 @@ export default class Block extends cc.Component { }, tim); } - stopTimeCutDown() { + stopTimeCutDown() { if (this.scheduleCallback) { this.unschedule(this.scheduleCallback); - this.scheduleCallback = null; + this.scheduleCallback = null; } } setVibrate(type, count) { diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index f56bf7c..74c6c6e 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -2779,6 +2779,11 @@ export default class MapConroler extends cc.Component { // .start(); } + //提前判断游戏结束 + predict_End() { + + } + update(dt) { diff --git a/assets/Script/Sdk/MiniGameSdk.ts b/assets/Script/Sdk/MiniGameSdk.ts index dbde5bb..346c49b 100644 --- a/assets/Script/Sdk/MiniGameSdk.ts +++ b/assets/Script/Sdk/MiniGameSdk.ts @@ -1167,6 +1167,7 @@ export namespace MiniGameSdk { if (typeof wx !== 'undefined' && wx !== null) { console.log("设置用户注册属性"); API._ta.userSet({ register_time: time }); + API._ta.userSet({ uid: cc.fx.GameConfig.GM_INFO.uid }); } } @@ -1175,6 +1176,7 @@ export namespace MiniGameSdk { console.log("上传金币和关卡信息给数数") API._ta.userSet({ current_level: (cc.fx.GameConfig.GM_INFO.level + 1) }); API._ta.userSet({ current_coin: cc.fx.GameConfig.GM_INFO.coin }); + API._ta.userSet({ uid: cc.fx.GameConfig.GM_INFO.uid }); } } @@ -1190,6 +1192,7 @@ export namespace MiniGameSdk { current_health: cc.fx.GameConfig.GM_INFO.hp, //当前体力值 tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币 version: cc.fx.GameConfig.GM_INFO.version.toString(),//当前版本号 + uid: cc.fx.GameConfig.GM_INFO.uid, //用户id }; if (register_time != null) { console.log("设置用户公共属性注册:————————————", register_time); @@ -1199,6 +1202,7 @@ export namespace MiniGameSdk { tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币 version: cc.fx.GameConfig.GM_INFO.version.toString(), register_time: register_time, + uid: cc.fx.GameConfig.GM_INFO.uid, //用户id pay_user: pay_user }; } @@ -1209,6 +1213,7 @@ export namespace MiniGameSdk { current_health: cc.fx.GameConfig.GM_INFO.hp, //当前体力值 tmp_coin: cc.fx.GameConfig.GM_INFO.coin,//当前金币 version: cc.fx.GameConfig.GM_INFO.version.toString(), + uid: cc.fx.GameConfig.GM_INFO.uid, //用户id pay_user: pay_user } } diff --git a/assets/shop/script/shop.ts b/assets/shop/script/shop.ts index e5e1a88..80e100e 100644 --- a/assets/shop/script/shop.ts +++ b/assets/shop/script/shop.ts @@ -167,6 +167,7 @@ export default class NewClass extends cc.Component { const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo; cc.fx.GameConfig.GM_INFO.iosOutTradeNo = ""; this.openLoad(); + this.btn_Touch = true; Utils.getIosPayInfo(iosOutTradeNo, (data) => { console.log("获得轮训结果:", data); @@ -394,6 +395,7 @@ export default class NewClass extends cc.Component { // MiniGameSdk.API.showToast("IOS系统暂不支持支付"); // this.btn_Touch = true; this.openLoad(); + this.btn_Touch = true; let iosPayInfo = { price: price, payment_name: productId, @@ -420,6 +422,7 @@ export default class NewClass extends cc.Component { // }, 500); this.openLoad(); + this.btn_Touch = true; //console.log("7.14_____________________", "调用充值接口"); Utils.buyProp(id, count, price, systemType, productId, (res) => { //console.log("获得充值结果", res);