chore:剔除无关内容
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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 +0,0 @@
|
||||
{"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"a5f9f430-fa04-4fb2-8af4-0e7176a078ce","files":[],"subMetas":{},"userData":{}}
|
||||
@@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "b585f61b-a132-4319-aba3-2942d022565b",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user