From 4585780d026f346bc996a4ea15252c2a9777974a Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Fri, 17 Oct 2025 19:16:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0loading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scene/GameScene.fire | 2 +- assets/Script/SceneManager.ts | 10 ++++++++++ assets/Script/module/Tool/GameTool.ts | 20 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/assets/Scene/GameScene.fire b/assets/Scene/GameScene.fire index 6681481..6876cdd 100644 --- a/assets/Scene/GameScene.fire +++ b/assets/Scene/GameScene.fire @@ -17581,7 +17581,7 @@ "_srcBlendFactor": 770, "_dstBlendFactor": 771, "_spriteFrame": { - "__uuid__": "b51c6577-3f31-4777-bf4a-6bfad58f0612" + "__uuid__": "ab9b1a6d-9c1b-4d87-ba50-43dbe414eb7f" }, "_type": 0, "_sizeMode": 1, diff --git a/assets/Script/SceneManager.ts b/assets/Script/SceneManager.ts index 3622714..0c46694 100644 --- a/assets/Script/SceneManager.ts +++ b/assets/Script/SceneManager.ts @@ -512,6 +512,16 @@ export default class SceneManager extends cc.Component { } + openLoad() { + this.node.getChildByName("Loading").active = true; + this.node.getChildByName("Loading").getChildByName("load").stopAllActions(); + this.node.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever()); + } + + closeLoad() { + this.node.getChildByName("Loading").active = false; + } + update(dt) { } diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index aef320e..49082c5 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -1,4 +1,5 @@ +import JiaZai from "../../JiaZai"; import MapConroler from "../../Map"; import Freeze from "../../prop/Freeze"; import SceneManager from "../../SceneManager"; @@ -1475,6 +1476,24 @@ var GameTool = { onShowVideo(callback: Function, videoData: any) { if (typeof wx !== 'undefined' && wx !== null) { + let scene = null; + const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 + if (jiazaiNode) { + scene = jiazaiNode.getComponent(JiaZai); + if (scene) { + scene.openLoad(); + } + } else { + const canvasTemp = cc.find("Canvas"); // 假设 Canvas 节点 + if (canvasTemp) { + scene = canvasTemp.getComponent("SceneManager"); + if (scene) { + scene.openLoad(); + } + } else { + console.log("SceneManager 节点未找到"); + } + } let requestData = { ad_type: "激励视频", //广告类型 ad_placement_name: videoData.ad_placement_name, //内部广告位名称 //2000复活 道具 2001 2002 2003 @@ -1487,6 +1506,7 @@ var GameTool = { console.log('用户看的视频广告个数是:', count); // 根据用户观看广告的结果,执行不同的逻辑s console.log('用户观看视频广告结果:', res); + if (scene) scene.closeLoad(); let duration = Math.floor(Date.now() / 1000) - cc.fx.GameConfig.GM_INFO.videoTime; if (duration <= 0) duration = 0; let data = {