Spring774
2025-10-30 a972605e1cf8122330de5b6ff53857be130972be
assets/Script/SkinLayer.ts
@@ -111,9 +111,13 @@
    }
    onClickWatchAd() {
        Global.debounceClicks(() => {
            let isGot = false;
        if (Sdk.isToutiao) {
            SdkToutiao.showRewardVideoAd(() => {
                    if (!isGot) {
                Userdata.giveVideoRewardRuby();
                        // Global.showTip("Got " + Global.WATCH_VIDEO_GEM + " Gems !");
                Global.showTip("获得 " + Global.WATCH_VIDEO_GEM + " 钻石 !");
                this.updateGems();
@@ -121,6 +125,7 @@
                let node = cc.find('Canvas');
                if (node) {
                    node.emit('updateInfo');
                        }
                }
            }, () => {
                Global.showTip('广告展示失败, 请稍后重试!');
@@ -131,8 +136,10 @@
        Sdk.ins.showVideoAd(result => {
            if (result) {
                    if (!isGot) {
                Userdata.giveVideoRewardRuby();
                Global.showTip("Got " + Global.WATCH_VIDEO_GEM + " Gems !");
                        // Global.showTip("Got " + Global.WATCH_VIDEO_GEM + " Gems !");
                        Global.showTip("获得 " + Global.WATCH_VIDEO_GEM + " 钻石 !");
                this.updateGems();
                Userdata.saveUserdata();
@@ -140,9 +147,13 @@
                if (node) {
                    node.emit('updateInfo');
                }
                    }
            } else {
                Global.showTip('Ads not ready!');
                    Global.showTip('广告展示失败, 请稍后重试!');
                    // Global.showTip('Ads not ready!');
            }
        });
        }, 'SkinLayer-onClickWatchAd');
    }
}