From a972605e1cf8122330de5b6ff53857be130972be Mon Sep 17 00:00:00 2001
From: Spring774 <337905794@qq.com>
Date: Thu, 30 Oct 2025 11:59:53 +0800
Subject: [PATCH] 添加华为广告,界面还需要去除不需要华为的地方

---
 assets/Script/RewardLayer.ts |   68 ++++++++++++++++++---------------
 1 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/assets/Script/RewardLayer.ts b/assets/Script/RewardLayer.ts
index e7494a4..4006b69 100644
--- a/assets/Script/RewardLayer.ts
+++ b/assets/Script/RewardLayer.ts
@@ -17,20 +17,22 @@
     eventNode: cc.Node = null;
 
     onClickClose() {
-        SoundManager.playButton();
-        this.cliamReward(1);
-        this.hide();
+        Global.debounceClicks(() => {
+            SoundManager.playButton();
+            this.cliamReward(1);
+            this.hide();
+        }, 'RewardLayer-onClickClose');
     }
 
     hide() {
         this.node.destroy();
     }
 
-    onDisable(){
+    onDisable() {
         Userdata.saveUserdata();
     }
 
-    setEventNode(node: cc.Node){
+    setEventNode(node: cc.Node) {
         this.eventNode = node;
     }
 
@@ -49,34 +51,38 @@
     }
 
     onClickCliam() {
-        SoundManager.playButton();
+        Global.debounceClicks(() => {
+            SoundManager.playButton();
 
-        if (this.isGot) {
-            return;
-        }
+            if (this.isGot) {
+                return;
+            }
 
-        if (Sdk.isToutiao) {
-            SdkToutiao.showRewardVideoAd(() => {
-                if (!this.isGot){
-                    this.isGot = true;
-                    this.cliamReward(5);
-                    this.hide();
-                }
-            }, () => {
-                Global.showTip('广告展示失败, 请稍后重试!!');
-            });
-        } else {
-            Sdk.ins.showVideoAd((res) => {
-                if (res) {
-                    this.isGot = true;
-                    this.cliamReward(5);
-                    this.hide();
-                } else {
-                    Global.showTip('No ads ready!!');
-                }
-            });
-        }
+            if (Sdk.isToutiao) {
+                SdkToutiao.showRewardVideoAd(() => {
+                    if (!this.isGot) {
+                        this.isGot = true;
+                        this.cliamReward(5);
+                        this.hide();
+                    }
+                }, () => {
+                    Global.showTip('广告展示失败, 请稍后重试!!');
+                });
+            } else {
+                Sdk.ins.showVideoAd((res) => {
+                    if (res) {
+                        if (!this.isGot) {
+                            this.isGot = true;
+                            this.cliamReward(5);
+                            this.hide();
+                        }
+                    } else {
+                        Global.showTip('广告展示失败, 请稍后重试!!');
+                        // Global.showTip('No ads ready!!');
+                    }
+                });
+            }
 
-
+        }, 'RewardLayer-onClickCliam');
     }
 }

--
Gitblit v1.9.1