chore:剔除无关内容

This commit is contained in:
2026-07-15 11:38:16 +08:00
parent 901df08646
commit 447f311e39
77 changed files with 1874 additions and 14022 deletions
+2 -14
View File
@@ -1,4 +1,4 @@
import { _decorator, AssetManager, Camera, Component, instantiate, math, Node, Prefab, resources, sys } from 'cc';
import { _decorator, AssetManager, Camera, Component, instantiate, math, Node, Prefab, resources } from 'cc';
import { Ragdoll } from '../Ragdoll/Ragdoll';
import { EventCenter } from './EventCenter';
import { LevelState } from './EnumFile';
@@ -82,12 +82,6 @@ export class BattleLevel extends Component {
this.levelIndex = levelIndex
// levelIndex = 1
if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
tt.reportAnalytics('start_level', {
level: this.levelIndex,
});
}
let config = DataMgr.getInstance().GetDataById(LevelConfig, levelIndex);
this.qingBaoTarget = null
@@ -199,12 +193,6 @@ export class BattleLevel extends Component {
win() {
if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
tt.reportAnalytics('end_level', {
level: this.levelIndex,
});
}
this.levelState = LevelState.Result
let levelResult = new BattleResult()
let remainTimer = Math.ceil(this.timer)
@@ -277,4 +265,4 @@ export class BattleResult {
coinCount: number
timerCoin: number
enemyCoin: number
}
}
@@ -93,11 +93,6 @@ export class LocalSaveMgr extends Component {
this.save()
}
setSideTip() {
this.playerData.haveGetSideReward = true
this.save()
}
adsAddPower() {
this.playerData.power += 3
EventCenter.powerChange.emit("powerChange")
@@ -114,14 +109,6 @@ export class LocalSaveMgr extends Component {
return Config.powerCD - passTime
}
setShareTime() {
const date: Date = new Date();
const dayOfMonth: number = date.getDate();
this.playerData.day = dayOfMonth
this.save()
console.log(dayOfMonth)
}
protected update(dt: number): void {
if (this.playerData.power < Config.maxHp) {
if (this.playerData.isOnTimerRun == false) {
@@ -161,10 +148,7 @@ class PlayerData {
ownWeapon: number[] = [1]
lastAddPowerTimer: number = null
isOnTimerRun: boolean = false
haveGetSideReward: boolean = false
haveShare: boolean = false
haveTutorial: boolean = false
day: number = -1
jsonDataInit(obj) {
if (obj == null) return
if (obj.muteMusic != null)
@@ -185,12 +169,6 @@ class PlayerData {
this.power = obj.power
if (obj.isOnTimerRun != null)
this.isOnTimerRun = obj.isOnTimerRun
if (obj.haveGetSideReward != null)
this.haveGetSideReward = obj.haveGetSideReward
if (obj.haveShare != null)
this.haveShare = obj.haveShare
if (obj.day != null)
this.day = obj.day
if (obj.haveTutorial != null)
this.haveTutorial = obj.haveTutorial
}
-213
View File
@@ -1,213 +0,0 @@
import { _decorator, Component, director, game, Node, sys } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('DYSdk')
export class DYSdk extends Component {
@property({ displayName: "bannner广告uid" })
bannerId: string = "test";
@property({ displayName: "视频奖励广告uid" })
videoUid: string = "test";
@property({ displayName: "插屏广告uid" })
interstitialUid: string = "test";
@property({ displayName: "分享图url" })
shareImageUrl: string = "https://mmocgame.qpic.cn/wechatgame/fNvVoACuBEOmNhzE802RLqnUuQyZ4rXTicDqz7OlVKypjYcHHo7nyfoYe7Urvdk6T/0";
@property({ displayName: "分享tile文本" })
shareTilt: string = "分享文本";
bannerAdv = null
videoAdv = null
interstitialAd = null
static instance: DYSdk;
protected onLoad(): void {
DYSdk.instance = this
}
successCallback = null
failedCallback = null
initBanner() {
let winSize = window["tt"].getSystemInfoSync();//获取像素size
// 创建 Banner 广告实例,提前初始化
let bannerWidth = 300
let bannerHeight = 80
console.error("bannerId:", this.bannerId)
this.bannerAdv = window["tt"].createBannerAd({
adUnitId: this.bannerId,//传入自己的id,此处为banner广告位ID
adIntervals: 30,//定时刷新,最低30S
style: {
left: (winSize.windowWidth - bannerWidth) / 2,
top: winSize.windowHeight - bannerHeight,
width: bannerWidth,
},
})
//重新定banner位置
this.bannerAdv.onResize((res) => {
this.bannerAdv.style.top = winSize.windowHeight - this.bannerAdv.style.realHeight - 1;
})
this.bannerAdv.onError((err) => {
console.log("banner", err);
})
}
navigateToScene() {
window["tt"].navigateToScene({
scene: 'sidebar',
fail: console.log,
success: console.log
})
}
initVideo() {
let self = this
// 创建激励视频广告实例,提前初始化
console.log("激励视频广告id:", this.videoUid)
this.videoAdv = window["tt"].createRewardedVideoAd({
adUnitId: this.videoUid//传入自己的id,此处为视频广告位ID
})
this.videoAdv.onLoad(() => {
console.log("广告加载完成");
});
this.videoAdv.onError(() => {
console.log("广告错误");
if (self.failedCallback) {
self.failedCallback();
}
});
function listener(res) {
if (res && res.isEnded) {
if (self.successCallback) {
self.successCallback();
self.successCallback = null
}
} else {
if (self.failedCallback) {
self.failedCallback();
self.failedCallback = null
}
}
}
this.videoAdv.onClose(listener); //这里监听广告的close 事件
}
initInterstitial() {
if (window["tt"].createInterstitialAd) {
console.error("插屏广告id:", this.interstitialUid)
this.interstitialAd = window["tt"].createInterstitialAd({
adUnitId: this.interstitialUid//传入自己的id,此处为插屏广告位ID
})
}
}
init() {
if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
this.initBanner()
this.initVideo()
// 创建插屏广告实例,提前初始化
this.initInterstitial()
this.passivityShare()
window["tt"].onShow(op => {
if (op.location == "sidebar_card") {
console.log("应用侧边栏启动");
}
console.log("监听应用启动", op);
});
}
}
// 主动分享
public initativeShare(callBack?: any) {
let shareTitle = this.shareTilt
let imageUrl = this.shareImageUrl
// 主动拉起转发,进入选择通讯录界面
window["tt"].shareAppMessage({
// 转发标题, 没有则默认使用小游戏的昵称
title: shareTitle,
// 图片链接,
imageUrl: imageUrl
});
}
passivityShare(callBack?: any) {
// 授权显示菜单
window["tt"].showShareMenu({
withShareTicket: false,
// 显示菜单
menus: ['shareAppMessage', 'shareTimeline'],
success: (res) => {
console.log("开始被动转发shareMenu成功");
},
fail: () => {
console.log("开始被动转发shareMenu失败");
}
});
}
showBanner() {
this.bannerAdv.show()
}
hideBanner() {
this.bannerAdv.hide()
}
showInterstitial() {
// 在适合的场景显示插屏广告
if (this.interstitialAd) {
this.interstitialAd.show().catch((err) => {
console.error(err)
})
}
}
showVideo(successCallback, failCallback) {
// 用户触发广告后,显示激励视频广告
let self = this
this.successCallback = successCallback
this.failedCallback = failCallback
self.videoAdv.onError((res) => {
console.log('广告出错监听', res)
})
// /**展示 */
self.videoAdv
.show()
.then(() => {
})
.catch(err => {
console.log('打印激励视频错误', err)
// 可以手动加载一次
self.videoAdv.load().then(() => {
// 加载成功后需要再显示广告
return self.videoAdv.show();
});
});
}
}
@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "e50a24d5-8754-4829-87a9-f39e0213fe5e",
"files": [],
"subMetas": {},
"userData": {}
}
+19 -78
View File
@@ -1,87 +1,28 @@
import { _decorator, Button, Component, director, game, Label, Node, sys, Tween } from 'cc';
import { WXSdk } from './WXSdk';
import { DYSdk } from './DYSdk';
import { AudioMgr } from '../audio/AudioMgr';
const { ccclass, property } = _decorator;
import { _decorator, Component } from 'cc';
const { ccclass } = _decorator;
/**
* Integration seam for a future rewarded-placement provider.
* The project currently ships without any advertising or platform SDK.
*/
export interface RewardProvider {
requestReward(onGranted: () => void): void;
}
@ccclass('SdkMgr')
export class SdkMgr extends Component {
export class SdkMgr extends Component implements RewardProvider {
static instance: SdkMgr;
protected onLoad(): void {
SdkMgr.instance = this
}
protected start(): void {
this.init()
SdkMgr.instance = this;
}
init() {
if (sys.platform == sys.Platform.WECHAT_GAME) {
WXSdk.instance.init()
} else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
DYSdk.instance.init()
}
}
playerRewardAds(successCallBack) {
AudioMgr.inst.pause()
director.pause()
console.log("广告开启", "pause")
let callBack = () => {
console.log("广告开启", "resume")
if (successCallBack != null)
successCallBack()
director.resume()
AudioMgr.inst.resume()
}
let failCallback = () => {
director.resume()
AudioMgr.inst.resume()
}
if (sys.platform == sys.Platform.WECHAT_GAME) {
WXSdk.instance.showVideo(callBack, failCallback)
} else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
DYSdk.instance.showVideo(callBack, failCallback)
} else {
callBack()
}
}
initativeShare() {
if (sys.platform == sys.Platform.WECHAT_GAME) {
WXSdk.instance.initativeShare()
} else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
DYSdk.instance.initativeShare()
}
}
showBanner() {
if (sys.platform == sys.Platform.WECHAT_GAME) {
WXSdk.instance.showBanner()
} else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
DYSdk.instance.showBanner()
}
}
hideBanner() {
if (sys.platform == sys.Platform.WECHAT_GAME) {
WXSdk.instance.hideBanner()
} else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
DYSdk.instance.hideBanner()
}
}
showInterstitial() {
if (sys.platform == sys.Platform.WECHAT_GAME) {
WXSdk.instance.showInterstitial()
} else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
DYSdk.instance.showInterstitial()
}
/**
* SDK-free default: grant the gameplay reward immediately.
* Replace this method body with a provider call when an SDK is added later.
*/
public requestReward(onGranted?: () => void): void {
onGranted?.();
}
}
-193
View File
@@ -1,193 +0,0 @@
import { _decorator, Component, director, game, Node, sys } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('WXSdk')
export class WXSdk extends Component {
@property({ displayName: "原生广告uid" })
bannerId: string = "";
@property({ displayName: "视频奖励广告uid" })
videoUid: string = "";
@property({ displayName: "插屏广告uid" })
interstitialUid: string = "";
@property({ displayName: "分享图url" })
shareImageUrl: string = "https://mmocgame.qpic.cn/wechatgame/fNvVoACuBEOmNhzE802RLqnUuQyZ4rXTicDqz7OlVKypjYcHHo7nyfoYe7Urvdk6T/0";
@property({ displayName: "分享tile文本" })
shareTilt: string = "超好玩解压停车场";
bannerAdv = null
videoAdv = null
interstitialAd = null
static instance: WXSdk;
protected onLoad(): void {
WXSdk.instance = this
}
successCallback = null
initBanner() {
let winSize = wx.getSystemInfoSync();//获取像素size
let bannerWidth = 300
let bannerHeight = 80
// 创建 原生模板 广告实例,提前初始化
let CustomAd = wx.createCustomAd({
adUnitId: 'adunit-dbdd10d1ca3690d2',
style: {
left: (winSize.windowWidth - bannerWidth) / 2,
top: winSize.windowHeight - bannerHeight,
width: bannerWidth,
}
})
// // 在适合的场景显示 原生模板 广告
// CustomAd.show()
// 监听 原生模板 广告错误事件
CustomAd.onError(err => {
console.error(err.errMsg)
});
this.bannerAdv = CustomAd
}
initVideo() {
// 创建激励视频广告实例,提前初始化
this.videoAdv = wx.createRewardedVideoAd({
adUnitId: this.videoUid//传入自己的id,此处为视频广告位ID
})
}
initInterstitial() {
if (wx.createInterstitialAd) {
this.interstitialAd = wx.createInterstitialAd({
adUnitId: this.interstitialUid//传入自己的id,此处为插屏广告位ID
})
}
}
init() {
if (sys.platform == sys.Platform.WECHAT_GAME) {
this.initBanner()
this.initVideo()
// 创建插屏广告实例,提前初始化
this.initInterstitial()
this.passivityShare()
}
}
// 主动分享
public initativeShare(callBack?: any) {
let shareTitle = this.shareTilt
let imageUrl = this.shareImageUrl
// 主动拉起转发,进入选择通讯录界面
wx.shareAppMessage({
// 转发标题, 没有则默认使用小游戏的昵称
title: shareTitle,
// 图片链接,
imageUrl: imageUrl
});
}
passivityShare(callBack?: any) {
// 授权显示菜单
wx.showShareMenu({
withShareTicket: false,
// 显示菜单
menus: ['shareAppMessage', 'shareTimeline'],
success: (res) => {
console.log("开始被动转发shareMenu成功");
},
fail: () => {
console.log("开始被动转发shareMenu失败");
}
});
let shareTitle = this.shareTilt
let imageUrl = this.shareImageUrl
// 好友点击回调
wx.onShareAppMessage(() => {
return {
// 转发标题, 没有则默认使用小游戏的昵称
title: shareTitle,
// 图片链接,
imageUrl: imageUrl
};
});
// 朋友圈点击回调
wx.onShareTimeline(() => {
return {
title: shareTitle,
imageUrl: imageUrl
};
});
}
showBanner() {
this.bannerAdv.show()
}
hideBanner() {
this.bannerAdv.hide()
}
showInterstitial() {
// 在适合的场景显示插屏广告
if (this.interstitialAd) {
this.interstitialAd.show().catch((err) => {
console.error(err)
})
}
}
showVideo(successCallback, failCallback) {
// 用户触发广告后,显示激励视频广告
if (this.videoUid == "test" || this.videoUid == "") {
successCallback()
return
}
let self = this
self.videoAdv.show().catch(() => {
// 失败重试
self.videoAdv.load()
.then(() => self.videoAdv.show())
.catch(err => {
console.log('激励视频 广告显示失败')
failCallback()
})
})
//拉取异常处理
self.videoAdv.onError((err) => {
console.log(err);
failCallback()
})
self.videoAdv.onClose((res) => {
if (!self.videoAdv) return;
self.videoAdv.offClose();//需要清除回调,否则第N次广告会一次性给N个奖励
//关闭
if (res && res.isEnded || res === undefined) {
//正常播放结束,需要下发奖励
successCallback()
} else {
//播放退出,不下发奖励
failCallback()
}
})
}
}
@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "73835816-1977-46d1-ac3b-0a0843758eae",
"files": [],
"subMetas": {},
"userData": {}
}
+1 -1
View File
@@ -30,7 +30,7 @@ export class AddHeartPanel extends PanelBase {
addPowerCallBack() {
AudioMgr.inst.playOneShot(AssetController.instance.click)
SdkMgr.instance.playerRewardAds(() => {
SdkMgr.instance.requestReward(() => {
LocalSaveMgr.instance.adsAddPower()
UIManager.instance.closePanel(AddHeartPanel)
})
+1 -1
View File
@@ -45,7 +45,7 @@ export class LosePanel extends PanelBase {
onClickAddTime() {
AudioMgr.inst.playOneShot(AssetController.instance.click)
SdkMgr.instance.playerRewardAds(() => {
SdkMgr.instance.requestReward(() => {
GameController.getInstance().curLevel.addTimer()
GameController.getInstance().curLevel.ContinueRun()
UIManager.instance.closePanel(LosePanel)
+3 -38
View File
@@ -1,5 +1,5 @@
import { _decorator, Asset, Button, Component, debug, instantiate, Label, Node, Prefab, randomRange, Sprite, sys, Tween, tween, Vec3 } from 'cc';
import { _decorator, Asset, Button, Component, debug, instantiate, Label, Node, Prefab, randomRange, Sprite, Tween, tween, Vec3 } from 'cc';
import { LocalSaveMgr } from '../framework/data/LocalSaveMgr';
import { UIManager } from '../framework/ui/UIManager';
import { UISwitcher } from '../framework/ui/UISwitcher';
@@ -12,8 +12,6 @@ import { Weapon } from '../data/ConfigData';
import { AddHeartPanel } from './AddHeartPanel';
import { SdkMgr } from '../framework/sdk/SdkMgr';
import { EventCenter } from '../EventCenter';
import { SideTipPanel } from './SideTipPanel';
import { SharePanel } from './SharePanel';
const { ccclass, property } = _decorator;
@@ -64,9 +62,6 @@ export class MainPanel extends PanelBase {
@property({ type: Button })
addHeartBtn: Button = null;
@property({ type: Button })
shareBtn: Button = null;
@property({ type: Prefab })
weaponSelectPrefab: Prefab = null;
@@ -79,9 +74,6 @@ export class MainPanel extends PanelBase {
@property(Node)
fingerNode: Node = null;
@property({ type: Button })
sideTipBtn: Button = null;
weaponDatas: Array<Weapon> = []
private weaponOffset: number = 1000
@@ -110,18 +102,6 @@ export class MainPanel extends PanelBase {
}
}
if (sys.platform == sys.Platform.WECHAT_GAME) {
this.sideTipBtn.node.active = false
const date: Date = new Date();
const dayOfMonth: number = date.getDate();
if (LocalSaveMgr.instance.playerData.day != dayOfMonth) {
this.shareBtn.node.active = true
}
} else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
this.sideTipBtn.node.active = true
this.shareBtn.node.active = false
}
this.fingerNode.active = !LocalSaveMgr.instance.playerData.haveTutorial
@@ -255,7 +235,7 @@ export class MainPanel extends PanelBase {
clickAddMoneyBtn() {
AudioMgr.inst.playOneShot(AssetController.instance.click)
SdkMgr.instance.playerRewardAds(() => {
SdkMgr.instance.requestReward(() => {
let addPoint = 200
let fromeMoney = LocalSaveMgr.instance.playerData.coin
@@ -265,7 +245,7 @@ export class MainPanel extends PanelBase {
})
}
flyShareMoney(fromMoney: number, endMoney: number) {
flyRewardMoney(fromMoney: number, endMoney: number) {
AudioMgr.inst.playOneShot(AssetController.instance.getCoin)
for (let index = 0; index < 10; index++) {
let item = instantiate(this.flyMoneyPrefab)
@@ -339,20 +319,10 @@ export class MainPanel extends PanelBase {
MainPanel.instance.refreshToIndex()
}
clickSideTipBtn() {
AudioMgr.inst.playOneShot(AssetController.instance.click)
console.log("openPanel SideTipPanel")
UIManager.instance.openPanel(SideTipPanel)
}
protected onDestroy(): void {
EventCenter.coinCountChange.off("coinCountChange", this.onCoinCountChange)
}
clickShareBtn() {
UIManager.instance.openPanel(SharePanel)
}
onLoad() {
MainPanel.instance = this;
this.startBtn.node.on(Button.EventType.CLICK, this.startBtnCallBack, this);
@@ -360,11 +330,6 @@ export class MainPanel extends PanelBase {
this.right.node.on(Button.EventType.CLICK, this.clickRight, this);
this.equip.node.on(Button.EventType.CLICK, this.clickEquipBtn, this);
this.buy.node.on(Button.EventType.CLICK, this.clickBuyBtn, this);
this.sideTipBtn.node.on(Button.EventType.CLICK, this.clickSideTipBtn, this);
this.shareBtn.node.on(Button.EventType.CLICK, this.clickShareBtn, this);
this.clear.node.on(Button.EventType.CLICK, this.clickClear, this);
this.addHeartBtn.node.on(Button.EventType.CLICK, this.clickAddHeartBtn, this);
this.addMoneyBtn.node.on(Button.EventType.CLICK, this.clickAddMoneyBtn, this);
+3 -15
View File
@@ -1,4 +1,4 @@
import { _decorator, animation, Animation, AnimationComponent, Button, Component, EventTouch, Input, input, instantiate, Label, math, Node, Prefab, randomRange, randomRangeInt, screen, Screen, sys, tween, Vec2, Vec3, view } from 'cc';
import { _decorator, animation, Animation, AnimationComponent, Button, Component, EventTouch, Input, input, instantiate, Label, math, Node, Prefab, randomRange, randomRangeInt, screen, Screen, tween, Vec2, Vec3, view } from 'cc';
import { PanelBase } from '../framework/ui/PanelBase';
import { FPSCameraController } from '../FPSCameraController';
import { GameController } from '../GameController';
@@ -137,14 +137,8 @@ export class PlayPanel extends PanelBase {
}
onClickQingBao() {
if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
tt.reportAnalytics('use_prop', {
level: GameController.getInstance().curLevel.levelIndex,
});
}
AudioMgr.inst.playOneShot(AssetController.instance.click)
SdkMgr.instance.playerRewardAds(() => {
SdkMgr.instance.requestReward(() => {
UIManager.instance.openPanel(QingBaoPanel)
this.closeTip()
@@ -165,14 +159,8 @@ export class PlayPanel extends PanelBase {
offset: Vec2
onClickSaoMiao() {
if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
tt.reportAnalytics('use_prop', {
level: GameController.getInstance().curLevel.levelIndex,
});
}
AudioMgr.inst.playOneShot(AssetController.instance.click)
SdkMgr.instance.playerRewardAds(() => {
SdkMgr.instance.requestReward(() => {
this.saoMiaoTip.active = true
GameController.getInstance().curLevel.SetSaoMiaoTarget()
this.offset = new Vec2(randomRange(-200, 200), randomRange(-200, 200))
-64
View File
@@ -1,64 +0,0 @@
import { _decorator, Button, Component, Label, Node, sys, Tween, tween, Vec3 } from 'cc';
import { LocalSaveMgr } from '../framework/data/LocalSaveMgr';
import { UIManager } from '../framework/ui/UIManager';
import { UISwitcher } from '../framework/ui/UISwitcher';
import { AudioMgr } from '../framework/audio/AudioMgr';
import { PanelBase } from '../framework/ui/PanelBase';
import { AssetController } from '../AssetController';
import { GameController } from '../GameController';
import { SdkMgr } from '../framework/sdk/SdkMgr';
import { WXSdk } from '../framework/sdk/WXSdk';
import { MainPanel } from './MainPanel';
const { ccclass, property } = _decorator;
@ccclass('SharePanel')
export class SharePanel extends PanelBase {
static instance: SharePanel;
@property({ type: Button })
shareBtn: Button = null;
@property({ type: Button })
closeBtn: Button = null;
onLoad() {
SharePanel.instance = this;
this.closeBtn.node.on(Button.EventType.CLICK, this.closeBtnCallBack, this);
this.shareBtn.node.on(Button.EventType.CLICK, this.shareCallBack, this);
}
activeShareBtn() {
const date: Date = new Date();
const dayOfMonth: number = date.getDate();
if (LocalSaveMgr.instance.playerData.day == dayOfMonth) {
this.shareBtn.node.active = false
} else {
this.shareBtn.node.active = true
}
}
shareCallBack() {
AudioMgr.inst.playOneShot(AssetController.instance.click)
if (sys.platform == sys.Platform.WECHAT_GAME)
WXSdk.instance.initativeShare()
let fromeMoney = LocalSaveMgr.instance.playerData.coin
LocalSaveMgr.instance.addCoin(200)
LocalSaveMgr.instance.setShareTime()
let endMoney = LocalSaveMgr.instance.playerData.coin
MainPanel.instance.flyShareMoney(fromeMoney, endMoney)
UIManager.instance.closePanel(SharePanel)
}
closeBtnCallBack(button: Button) {
AudioMgr.inst.playOneShot(AssetController.instance.click)
UIManager.instance.closePanel(SharePanel)
}
start() {
this.activeShareBtn()
}
}
-1
View File
@@ -1 +0,0 @@
{"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"a5f9f430-fa04-4fb2-8af4-0e7176a078ce","files":[],"subMetas":{},"userData":{}}
-64
View File
@@ -1,64 +0,0 @@
import { _decorator, Button, Component, Label, Node, sys, Tween, tween, Vec3 } from 'cc';
import { LocalSaveMgr } from '../framework/data/LocalSaveMgr';
import { UIManager } from '../framework/ui/UIManager';
import { UISwitcher } from '../framework/ui/UISwitcher';
import { AudioMgr } from '../framework/audio/AudioMgr';
import { PanelBase } from '../framework/ui/PanelBase';
import { AssetController } from '../AssetController';
import { GameController } from '../GameController';
import { DYSdk } from '../framework/sdk/DYSdk';
const { ccclass, property } = _decorator;
@ccclass('SideTipPanel')
export class SideTipPanel extends PanelBase {
static instance: SideTipPanel;
@property({ type: Button })
rewardBtn: Button = null;
@property({ type: Button })
closeBtn: Button = null;
@property({ type: Node })
getNode: Node = null;
onLoad() {
SideTipPanel.instance = this;
this.closeBtn.node.on(Button.EventType.CLICK, this.closeBtnCallBack, this);
this.rewardBtn.node.on(Button.EventType.CLICK, this.rewardCallBack, this);
}
rewardCallBack() {
AudioMgr.inst.playOneShot(AssetController.instance.click)
if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME)
DYSdk.instance.navigateToScene()
LocalSaveMgr.instance.addCoin(888)
LocalSaveMgr.instance.setSideTip();
this.getNode.active = LocalSaveMgr.instance.playerData.haveGetSideReward
this.rewardBtn.node.active = !LocalSaveMgr.instance.playerData.haveGetSideReward
}
protected onOpen(): void {
this.getNode.active = LocalSaveMgr.instance.playerData.haveGetSideReward
this.rewardBtn.node.active = !LocalSaveMgr.instance.playerData.haveGetSideReward
}
closeBtnCallBack(button: Button) {
AudioMgr.inst.playOneShot(AssetController.instance.click)
// AudioMgr.inst.playOneShot(AssetController.instance.click)
UIManager.instance.closePanel(SideTipPanel)
}
start() {
}
}
-9
View File
@@ -1,9 +0,0 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "b585f61b-a132-4319-aba3-2942d022565b",
"files": [],
"subMetas": {},
"userData": {}
}
+1 -2
View File
@@ -89,7 +89,7 @@ export class WinPanel extends PanelBase {
this.rewardDouble = 1
}
this.runingPoint = false
SdkMgr.instance.playerRewardAds(() => {
SdkMgr.instance.requestReward(() => {
let addPoint = Math.ceil((this.curResult.coinCount * this.rewardDouble))
let fromeMoney = LocalSaveMgr.instance.playerData.coin
LocalSaveMgr.instance.addCoin(addPoint)
@@ -101,7 +101,6 @@ export class WinPanel extends PanelBase {
onClickContinueBtn() {
AudioMgr.inst.playOneShot(AssetController.instance.click)
GameController.getInstance().backMain()
SdkMgr.instance.showInterstitial()
}
backMain() {