baowen пре 3 недеља
родитељ
комит
df4af4fd03

Разлика између датотеке није приказан због своје велике величине
+ 577 - 189
assets/editor/prefab/SuperFindPanel.prefab


+ 95 - 13
assets/editor/script/AddCountPanel.ts

@@ -1,14 +1,26 @@
-import { _decorator, Component, Node } from 'cc';
+import { _decorator, Button, Component, Label, Node, sys } from 'cc';
 import { Difficulty, SuperFind } from '../../script/Manager/LocalDataMgr';
 import EventMgr from '../../script/Manager/EventMgr';
+import { mainscene } from '../../script/mainscene';
+import PlatformService from '../../script/Platform/PlatformService';
 const { ccclass, property } = _decorator;
 
 @ccclass('AddCountPanel')
 export class AddCountPanel extends Component {
     @property(Node)
     btnClose:Node = null
+    @property(Label)
+    labCount:Label = null
+    @property(Button)
+    btnAdd5:Button = null
+    @property(Button)
+    btnAdd30:Button = null
+
+    watchAdvCount:number = 0
     start() {
         this.btnClose.on(Node.EventType.TOUCH_END,this.close,this)
+        this.btnAdd5.node.on(Node.EventType.TOUCH_END,this.AddCount5,this)
+        this.btnAdd30.node.on(Node.EventType.TOUCH_END,this.AddCount30,this)
     }
 
     close()
@@ -16,20 +28,90 @@ export class AddCountPanel extends Component {
         this.node.active = false
     }
 
-    AddCount(event,customEventData)
+    AddCount5()
     {
-        let count = Number(customEventData)
-        Difficulty.difficutyData.difficutyCount += count
-        if(Difficulty.difficutyData.difficutyCount > 30)
-        {
-            Difficulty.difficutyData.difficutyCount = 30
+        if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+            mainscene.instance.ge.track(
+                "ad_show", //追踪事件的名称
+                {
+                    version: "123",
+                    ad_position: "小熊数量+5",
+                    level_id: SuperFind.superFindData.currentBgKey
+                } //需要上传的事件属性
+            );
         }
-        Difficulty.createOrDeleteOtherScale();
-        Difficulty.saveDifficutyData();
-        SuperFind.setTitle()
-        EventMgr.ins.dispatchEvent("refreshLevelInfo")
-        this.node.active = false
-        EventMgr.ins.dispatchEvent("regenerate")
+
+        PlatformService.getInstance().platformApi.loadAndShowVideoAd(() => {
+            // PlatformService.getInstance().platformApi.reportAnalytics("tips", {
+            //     level: this.data.title
+            // })
+            if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+                mainscene.instance.ge.track(
+                    "ad_showend", //追踪事件的名称
+                    {
+                        version: "123",
+                        ad_position: "小熊数量+5",
+                        level_id: SuperFind.superFindData.currentBgKey
+                    } //需要上传的事件属性
+                );
+                let count = 5
+                Difficulty.difficutyData.difficutyCount += count
+                Difficulty.createOrDeleteOtherScale();
+                Difficulty.saveDifficutyData();
+                SuperFind.setTitle()
+                EventMgr.ins.dispatchEvent("refreshLevelInfo")
+                this.node.active = false
+                EventMgr.ins.dispatchEvent("regenerate")
+                this.btnAdd5.node.active = false
+            }
+        })
+    }
+    AddCount30()
+    {
+        //  AudioManager.instance.playBundleAudio("button")
+        if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+            mainscene.instance.ge.track(
+                "ad_show", //追踪事件的名称
+                {
+                    version: "123",
+                    ad_position: "小熊数量加至30",
+                    level_id: SuperFind.superFindData.currentBgKey
+                } //需要上传的事件属性
+            );
+        }
+
+        PlatformService.getInstance().platformApi.loadAndShowVideoAd(() => {
+
+            // PlatformService.getInstance().platformApi.reportAnalytics("tips", {
+            //     level: this.data.title
+            // })
+            if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+                mainscene.instance.ge.track(
+                    "ad_showend", //追踪事件的名称
+                    {
+                        version: "123",
+                        ad_position: "小熊数量加至30",
+                        level_id: SuperFind.superFindData.currentBgKey
+                    } //需要上传的事件属性
+                );
+                this.watchAdvCount++
+                if (this.watchAdvCount >= 2) {
+                    let count = 30
+                    Difficulty.difficutyData.difficutyCount += count
+                    if (Difficulty.difficutyData.difficutyCount > 30) {
+                        Difficulty.difficutyData.difficutyCount = 30
+                    }
+                    Difficulty.createOrDeleteOtherScale();
+                    Difficulty.saveDifficutyData();
+                    SuperFind.setTitle()
+                    EventMgr.ins.dispatchEvent("refreshLevelInfo")
+                    this.node.active = false
+                    EventMgr.ins.dispatchEvent("regenerate")
+                    this.btnAdd30.node.active = false
+                }
+                this.labCount.string = `${this.watchAdvCount}/${2}`
+            }
+        })
     }
 }
 

+ 34 - 6
assets/editor/script/SkinItem2.ts

@@ -1,7 +1,9 @@
-import { _decorator, Color, Component, instantiate, Node, Prefab, Sprite, Vec2, Vec3 } from 'cc';
+import { _decorator, Color, Component, instantiate, Node, Prefab, Sprite, sys, Vec2, Vec3 } from 'cc';
 import { SkinItem } from './SkinItem';
 import EventMgr from '../../script/Manager/EventMgr';
-import { allSkinList, Skin } from '../../script/Manager/LocalDataMgr';
+import { allSkinList, Skin, SuperFind } from '../../script/Manager/LocalDataMgr';
+import { mainscene } from '../../script/mainscene';
+import PlatformService from '../../script/Platform/PlatformService';
 const { ccclass, property } = _decorator;
 
 @ccclass('SkinItem2')
@@ -40,10 +42,36 @@ export class SkinItem2 extends SkinItem {
 
     override onClick()
     {
-        this.isUnlock = true
-        this.setBgColor(this.isUnlock)
-        this.lock.active = !this.isUnlock
-        Skin.addSelectSkin(this.key)
+        if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+            mainscene.instance.ge.track(
+                "ad_show", //追踪事件的名称
+                {
+                    version: "123",
+                    ad_position: "小熊解锁皮肤",
+                    level_id: SuperFind.superFindData.currentBgKey
+                } //需要上传的事件属性
+            );
+        }
+
+        PlatformService.getInstance().platformApi.loadAndShowVideoAd(() => {
+            // PlatformService.getInstance().platformApi.reportAnalytics("tips", {
+            //     level: this.data.title
+            // })
+            if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+                mainscene.instance.ge.track(
+                    "ad_showend", //追踪事件的名称
+                    {
+                        version: "123",
+                        ad_position: "小熊解锁皮肤",
+                        level_id: SuperFind.superFindData.currentBgKey
+                    } //需要上传的事件属性
+                );
+                this.isUnlock = true
+                this.setBgColor(this.isUnlock)
+                this.lock.active = !this.isUnlock
+                Skin.addSelectSkin(this.key)
+            }
+        })
     }
 
     onBtnUseClick()

+ 69 - 1
assets/editor/script/SuperFindPanel.ts

@@ -6,6 +6,8 @@ import { LevelContainer } from './LevelContainer';
 import { clearSuperFindAllData, defaultSkin, Difficulty, LocalDataMgr, Skin, SuperFind} from '../../script/Manager/LocalDataMgr';
 import EventMgr from '../../script/Manager/EventMgr';
 import { AddCountPanel } from './AddCountPanel';
+import { mainscene } from '../../script/mainscene';
+import PlatformService from '../../script/Platform/PlatformService';
 const { ccclass, property } = _decorator;
 
 @ccclass('SuperFindPanel')
@@ -167,7 +169,33 @@ export class SuperFindPanel extends Component {
 
     onTipClick()
     {
-        this.lvlContainer.showOneHint()
+        if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+            mainscene.instance.ge.track(
+                "ad_show", //追踪事件的名称
+                {
+                    version: "123",
+                    ad_position: "小熊提示",
+                    level_id: SuperFind.superFindData.currentBgKey
+                } //需要上传的事件属性
+            );
+        }
+
+        PlatformService.getInstance().platformApi.loadAndShowVideoAd(() => {
+            // PlatformService.getInstance().platformApi.reportAnalytics("tips", {
+            //     level: this.data.title
+            // })
+            if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+                mainscene.instance.ge.track(
+                    "ad_showend", //追踪事件的名称
+                    {
+                        version: "123",
+                        ad_position: "小熊提示",
+                        level_id: SuperFind.superFindData.currentBgKey
+                    } //需要上传的事件属性
+                );
+                this.lvlContainer.showOneHint()
+            }
+        })
     }
 
     refreshInfo()
@@ -201,6 +229,46 @@ export class SuperFindPanel extends Component {
         this.unschedule(this.countDown)
         this.schedule(this.countDown,1)
     }
+
+    addTime()
+    {
+        this._gameTime += 60
+        this.countDownLabel.string = this._gameTime.toString() + "秒"
+        this.unschedule(this.countDown)
+        this.schedule(this.countDown, 1)
+    }
+
+    OnClickShare() {
+        PlatformService.getInstance().platformApi.recordedGameScreenStop()
+        PlatformService.getInstance().platformApi.shareRecordedGameScreen()
+    }
+
+    OnClickAddtime() {
+        if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform ) {
+            mainscene.instance.ge.track(
+                "ad_show", //追踪事件的名称
+                {
+                    version: "123",
+                    ad_position: "小熊结算时加时",
+                    level_id: SuperFind.superFindData.currentBgKey
+                } //需要上传的事件属性
+            );
+        }
+
+        PlatformService.getInstance().platformApi.loadAndShowVideoAd(() => {
+            if (sys.Platform.BYTEDANCE_MINI_GAME == sys.platform) {
+                mainscene.instance.ge.track(
+                    "ad_showend", //追踪事件的名称
+                    {
+                        version: "123",
+                        ad_position: "小熊结算时加时",
+                        level_id: SuperFind.superFindData.currentBgKey
+                    } //需要上传的事件属性
+                );
+                this.addTime()
+            }
+        })
+    }
 }
 
 

Неке датотеке нису приказане због велике количине промена