chore:剔除无关内容
This commit is contained in:
@@ -3480,14 +3480,14 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "BTN_EnterReward",
|
||||
"_name": "RemovedPlatformReward",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 142
|
||||
@@ -3714,14 +3714,14 @@
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "BTN_ShareReward",
|
||||
"_name": "RemovedSocialReward",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 10
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 152
|
||||
@@ -6685,9 +6685,6 @@
|
||||
"addHeartBtn": {
|
||||
"__id__": 107
|
||||
},
|
||||
"shareBtn": {
|
||||
"__id__": 158
|
||||
},
|
||||
"weaponSelectPrefab": {
|
||||
"__uuid__": "cbdadf26-9f4a-4191-80c0-208a836d2253",
|
||||
"__expectedType__": "cc.Prefab"
|
||||
@@ -6702,9 +6699,6 @@
|
||||
"fingerNode": {
|
||||
"__id__": 38
|
||||
},
|
||||
"sideTipBtn": {
|
||||
"__id__": 148
|
||||
},
|
||||
"weaponContent": {
|
||||
"__id__": 191
|
||||
},
|
||||
@@ -6731,4 +6725,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "acfe0309-92ca-4b2a-8057-d15d6182d9da",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "SharePanel"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"ver": "1.1.50",
|
||||
"importer": "prefab",
|
||||
"imported": true,
|
||||
"uuid": "7af336a9-9267-4c2b-b263-a3fb6c344fd4",
|
||||
"files": [
|
||||
".json"
|
||||
],
|
||||
"subMetas": {},
|
||||
"userData": {
|
||||
"syncNodeName": "SideTipPanel"
|
||||
}
|
||||
}
|
||||
+34
-225
@@ -41,7 +41,7 @@
|
||||
"_active": true,
|
||||
"_components": [],
|
||||
"_prefab": {
|
||||
"__id__": 409
|
||||
"__id__": 403
|
||||
},
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
@@ -72,7 +72,7 @@
|
||||
},
|
||||
"autoReleaseAssets": false,
|
||||
"_globals": {
|
||||
"__id__": 415
|
||||
"__id__": 409
|
||||
},
|
||||
"_id": "cce78068-e13a-47f5-ae44-d1ac5c097bd7"
|
||||
},
|
||||
@@ -5631,17 +5631,17 @@
|
||||
{
|
||||
"__id__": 393
|
||||
},
|
||||
{
|
||||
"__id__": 395
|
||||
},
|
||||
{
|
||||
"__id__": 397
|
||||
},
|
||||
{
|
||||
"__id__": 399
|
||||
},
|
||||
{
|
||||
"__id__": 401
|
||||
},
|
||||
{
|
||||
"__id__": 403
|
||||
},
|
||||
{
|
||||
"__id__": 405
|
||||
},
|
||||
{
|
||||
"__id__": 407
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
@@ -5805,21 +5805,11 @@
|
||||
"_parent": {
|
||||
"__id__": 388
|
||||
},
|
||||
"_children": [
|
||||
{
|
||||
"__id__": 394
|
||||
},
|
||||
{
|
||||
"__id__": 396
|
||||
},
|
||||
{
|
||||
"__id__": 398
|
||||
}
|
||||
],
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 400
|
||||
"__id__": 394
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@@ -5852,187 +5842,6 @@
|
||||
},
|
||||
"_id": "73qS0HqktFNKy2EmghI+xD"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "SdkMgr",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 393
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 395
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "f41EJNspxGgp3J8KZlAxzW"
|
||||
},
|
||||
{
|
||||
"__type__": "6fbd6RxA9dOzJEaowwyH1c6",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 394
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"_id": "3067PstfBLDq8OCrp2H7iP"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "WXSdk",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 393
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 397
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "8eBPJL/O5GE5E9j6LlROVO"
|
||||
},
|
||||
{
|
||||
"__type__": "73835gWGXdG0aw7CghDdY6u",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 396
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"bannerId": "test",
|
||||
"videoUid": "test",
|
||||
"interstitialUid": "test",
|
||||
"shareImageUrl": "https://mmocgame.qpic.cn/wechatgame/Z53qiaERLZAG83WusI15WxLvKRlcTiaib4qUF50HbvJJnbXHEn8t3ibRt4j1EiaV7YxCg/0",
|
||||
"shareTilt": "外星人躲在哪里了!",
|
||||
"_id": "70DyQIfJJGRbYGyRI0YctW"
|
||||
},
|
||||
{
|
||||
"__type__": "cc.Node",
|
||||
"_name": "DYSdk",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"_parent": {
|
||||
"__id__": 393
|
||||
},
|
||||
"_children": [],
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 399
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
"_lpos": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_lrot": {
|
||||
"__type__": "cc.Quat",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0,
|
||||
"w": 1
|
||||
},
|
||||
"_lscale": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 1,
|
||||
"y": 1,
|
||||
"z": 1
|
||||
},
|
||||
"_mobility": 0,
|
||||
"_layer": 1073741824,
|
||||
"_euler": {
|
||||
"__type__": "cc.Vec3",
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"z": 0
|
||||
},
|
||||
"_id": "d97BEaP9RAMLUQMkdohvRz"
|
||||
},
|
||||
{
|
||||
"__type__": "e50a2TVh1RIKYep854CE/5e",
|
||||
"_name": "",
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 398
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
"bannerId": "test",
|
||||
"videoUid": "test",
|
||||
"interstitialUid": "test",
|
||||
"shareImageUrl": "https://mmocgame.qpic.cn/wechatgame/fNvVoACuBEOmNhzE802RLqnUuQyZ4rXTicDqz7OlVKypjYcHHo7nyfoYe7Urvdk6T/0",
|
||||
"shareTilt": "分享文本",
|
||||
"_id": "dfEXphTjZHA6A54PAnbQhI"
|
||||
},
|
||||
{
|
||||
"__type__": "6fbd6RxA9dOzJEaowwyH1c6",
|
||||
"_name": "",
|
||||
@@ -6057,7 +5866,7 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 402
|
||||
"__id__": 396
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@@ -6096,7 +5905,7 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 401
|
||||
"__id__": 395
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
@@ -6114,7 +5923,7 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 404
|
||||
"__id__": 398
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@@ -6153,7 +5962,7 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 403
|
||||
"__id__": 397
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
@@ -6195,7 +6004,7 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 406
|
||||
"__id__": 400
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@@ -6234,7 +6043,7 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 405
|
||||
"__id__": 399
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
@@ -6252,7 +6061,7 @@
|
||||
"_active": true,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 408
|
||||
"__id__": 402
|
||||
}
|
||||
],
|
||||
"_prefab": null,
|
||||
@@ -6291,7 +6100,7 @@
|
||||
"_objFlags": 0,
|
||||
"__editorExtras__": {},
|
||||
"node": {
|
||||
"__id__": 407
|
||||
"__id__": 401
|
||||
},
|
||||
"_enabled": true,
|
||||
"__prefab": null,
|
||||
@@ -6305,10 +6114,10 @@
|
||||
"instance": null,
|
||||
"targetOverrides": [
|
||||
{
|
||||
"__id__": 410
|
||||
"__id__": 404
|
||||
},
|
||||
{
|
||||
"__id__": 413
|
||||
"__id__": 407
|
||||
}
|
||||
],
|
||||
"nestedPrefabInstanceRoots": [
|
||||
@@ -6323,7 +6132,7 @@
|
||||
"__id__": 376
|
||||
},
|
||||
"sourceInfo": {
|
||||
"__id__": 411
|
||||
"__id__": 405
|
||||
},
|
||||
"propertyPath": [
|
||||
"_trailModule",
|
||||
@@ -6333,7 +6142,7 @@
|
||||
"__id__": 376
|
||||
},
|
||||
"targetInfo": {
|
||||
"__id__": 412
|
||||
"__id__": 406
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -6361,7 +6170,7 @@
|
||||
"__id__": 376
|
||||
},
|
||||
"targetInfo": {
|
||||
"__id__": 414
|
||||
"__id__": 408
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -6373,28 +6182,28 @@
|
||||
{
|
||||
"__type__": "cc.SceneGlobals",
|
||||
"ambient": {
|
||||
"__id__": 416
|
||||
"__id__": 410
|
||||
},
|
||||
"shadows": {
|
||||
"__id__": 417
|
||||
"__id__": 411
|
||||
},
|
||||
"_skybox": {
|
||||
"__id__": 418
|
||||
"__id__": 412
|
||||
},
|
||||
"fog": {
|
||||
"__id__": 419
|
||||
"__id__": 413
|
||||
},
|
||||
"octree": {
|
||||
"__id__": 420
|
||||
"__id__": 414
|
||||
},
|
||||
"skin": {
|
||||
"__id__": 421
|
||||
"__id__": 415
|
||||
},
|
||||
"lightProbeInfo": {
|
||||
"__id__": 422
|
||||
"__id__": 416
|
||||
},
|
||||
"postSettings": {
|
||||
"__id__": 423
|
||||
"__id__": 417
|
||||
},
|
||||
"bakedWithStationaryMainLight": false,
|
||||
"bakedWithHighpLightmap": false
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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": {}
|
||||
}
|
||||
@@ -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?.();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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": {}
|
||||
}
|
||||
@@ -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