future 1 anno fa
parent
commit
246f0a6154
3 ha cambiato i file con 18 aggiunte e 1 eliminazioni
  1. 4 0
      assets/script/config.ts
  2. 10 1
      assets/script/run/gameManager.ts
  3. 4 0
      assets/script/sdkUtil.ts

+ 4 - 0
assets/script/config.ts

@@ -329,6 +329,7 @@ export class config {
         LOOK_TIPS:"LOOK_TIPS",
         UN_LOCK_24:"UN_LOCK_24",
         UN_LOCK:"UN_LOCK",
+        ADD_TIME:"ADD_TIME",
     }
     static TOKEN:string = ""
     static USER_DATA:string = "userData"
@@ -340,6 +341,7 @@ export class config {
         LOOK_TIPS: "f6o78gcl7mec09m3b8",
         UN_LOCK_24: "38vhsipa5qe3tkpnve",
         UN_LOCK: "52kg38k634094h9b19",
+        ADD_TIME: "4ji5k7gbe5mge42657",
     }
     static WX_REWARD ={
         RE_LIFE: "",
@@ -347,6 +349,7 @@ export class config {
         LOOK_TIPS: "",
         UN_LOCK_24: "",
         UN_LOCK: "",
+        ADD_TIME: "",
     }
     static STATISTICS_ACTION_TYPE = {
         UNKNOWN: 0,              //未知
@@ -355,6 +358,7 @@ export class config {
         CHA_KAN_TI_SHI: 3,       //查看提示
         LIN_SHI_24_XIAO_SHI: 4,  //临时24小时
         TI_QIAN_JIE_SUO: 5,      //提前解锁
+        ADD_TIME: 6,             //加时间
     }
     static User_unlock_levels_number_status = {
         GET: 0,       //获取

+ 10 - 1
assets/script/run/gameManager.ts

@@ -727,7 +727,16 @@ export class gameManager extends Component {
 
     public static LookVideoCallBack(call){
         if(call!=null){
-            call()
+            let ad_id = SdkUtil.getAdId(config.AD_TYPE.ADD_TIME)
+            SdkUtil.showVideoAd(ad_id,(res)=>{
+                if(res.isEnded){
+                    call()
+                }
+                // 统计-激励视频广告
+                let level_id = gameManager.Singleton.getLevelData().id
+                let collect_data = statisticsManager.get_collect_ads_data(level_id, res, config.STATISTICS_ACTION_TYPE.ADD_TIME)
+                statisticsManager.request_collect_rewardVideoData(collect_data)
+            })
         }
     }
 

+ 4 - 0
assets/script/sdkUtil.ts

@@ -191,6 +191,8 @@ export class SdkUtil {
                 ad_id = config.TT_REWARD.UN_LOCK_24
             } else if (ad_type == config.AD_TYPE.UN_LOCK) {
                 ad_id = config.TT_REWARD.UN_LOCK
+            } else if (ad_type == config.AD_TYPE.ADD_TIME) {
+                ad_id = config.TT_REWARD.ADD_TIME
             }
         } else if (sys.platform == sys.Platform.WECHAT_GAME) {
             if(ad_type == config.AD_TYPE.RE_LIFE) {
@@ -203,6 +205,8 @@ export class SdkUtil {
                 ad_id = config.WX_REWARD.UN_LOCK_24
             } else if (ad_type == config.AD_TYPE.UN_LOCK) {
                 ad_id = config.WX_REWARD.UN_LOCK
+            } else if (ad_type == config.AD_TYPE.ADD_TIME) {
+                ad_id = config.WX_REWARD.ADD_TIME
             }
         }
         return ad_id