|
@@ -1,4 +1,4 @@
|
|
|
-import { _decorator, assetManager, Component, ImageAsset, instantiate, Node, Prefab, resources, SpriteFrame, Texture2D } from 'cc';
|
|
|
+import { _decorator, assetManager, Component, ImageAsset, instantiate, Node, Prefab, resources, SpriteFrame, sys, Texture2D } from 'cc';
|
|
|
import { config } from './config';
|
|
|
|
|
|
import { main } from './main';
|
|
@@ -6,6 +6,7 @@ import { car_item_data, edit_game_config_data, model_item_data, rankData, sysCon
|
|
|
import { game } from './game/game';
|
|
|
import { Util } from './util';
|
|
|
import { http } from './http';
|
|
|
+import { SdkUtil } from './sdkUtil';
|
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('tools')
|
|
@@ -64,6 +65,31 @@ export class tools {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ // 获取广告id
|
|
|
+ public static getAdId(ad_type = config.AD_TYPE.UNKNOWN):string {
|
|
|
+ let ad_id = ""
|
|
|
+ if(sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
|
|
|
+ // if(ad_type == config.AD_TYPE.RE_LIFE) {
|
|
|
+ // ad_id = config.TT_REWARD.RE_LIFE
|
|
|
+ // } else if (ad_type == config.AD_TYPE.ANSWER) {
|
|
|
+ // ad_id = config.TT_REWARD.ANSWER
|
|
|
+ // } else if (ad_type == config.AD_TYPE.LOOK_TIPS) {
|
|
|
+ // ad_id = config.TT_REWARD.LOOK_TIPS
|
|
|
+ // } else if (ad_type == config.AD_TYPE.UN_LOCK_24) {
|
|
|
+ // 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(SdkUtil.KS_GAME) {
|
|
|
+ // } else {
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ return ad_id
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|