|
|
@@ -18,14 +18,15 @@ export default class ATInterstitial extends zgSingleton {
|
|
|
private ifLoadShowArr: Array<boolean> = new Array();
|
|
|
|
|
|
/** 初始化 */
|
|
|
- init() {
|
|
|
+ async init() {
|
|
|
this.ATInterstitialJS = cc["ATInterstitialJS"];
|
|
|
this.ATInterstitialJS.proxy = this;;
|
|
|
this.ATInterstitialJS.init();
|
|
|
|
|
|
- for (var i = 0; i < 3; i++) {
|
|
|
+ for (var i = 2; i >= 0; i--) {
|
|
|
this.interAdStateArr[i] = InterAdState.Unload;
|
|
|
this.loadInter(i);
|
|
|
+ await mk.time.WaitForSeconds(1);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -86,6 +87,7 @@ export default class ATInterstitial extends zgSingleton {
|
|
|
* @param type 0 插屏 1 全屏 2 大插屏
|
|
|
*/
|
|
|
loadInter(type: number, ifLoadShow: boolean = false) {
|
|
|
+ mk.console.logSingle('ATInterstitialJS ', 'loadInter ' + type);
|
|
|
this.ifLoadShowArr[type] = ifLoadShow;
|
|
|
this.interAdStateArr[type] = InterAdState.Loading;
|
|
|
let id = this.getPlaceIDByType(type);
|
|
|
@@ -102,7 +104,7 @@ export default class ATInterstitial extends zgSingleton {
|
|
|
console.log('当前插屏类型正在展示');
|
|
|
}
|
|
|
else {
|
|
|
- mk.console.logSingle('inter ', 'showInter ' + type);
|
|
|
+ mk.console.logSingle('ATInterstitialJS ', 'showInter ' + type);
|
|
|
if (this.hasAdReady(type)) {
|
|
|
this.interAdStateArr[type] = InterAdState.Show;
|
|
|
this.ATInterstitialJS.showInter(this.getPlaceIDByType(type));
|
|
|
@@ -124,7 +126,7 @@ export default class ATInterstitial extends zgSingleton {
|
|
|
onInterstitialAdLoaded(placementId) {
|
|
|
let type = this.checkPlacementIDType(placementId);
|
|
|
this.interAdStateArr[type] = InterAdState.LoadSuccess;
|
|
|
- mk.console.logSingle('inter ', 'onInterstitialAdLoaded ' + type);
|
|
|
+ mk.console.logSingle('ATInterstitialJS ', 'onInterstitialAdLoaded ' + type);
|
|
|
|
|
|
if (this.ifLoadShowArr[type]) {
|
|
|
this.showInter(type);
|
|
|
@@ -136,7 +138,7 @@ export default class ATInterstitial extends zgSingleton {
|
|
|
this.interAdStateArr[type] = InterAdState.LoadFail;
|
|
|
let id = 11
|
|
|
|
|
|
- mk.console.logSingle('inter ', 'onInterstitialAdLoadFail ' + type);
|
|
|
+ mk.console.logSingle('ATInterstitialJS ', 'onInterstitialAdLoadFail ' + type);
|
|
|
if (type == 0) {
|
|
|
id = 11
|
|
|
}
|
|
|
@@ -153,7 +155,7 @@ export default class ATInterstitial extends zgSingleton {
|
|
|
this.interAdStateArr[type] = InterAdState.Show;
|
|
|
let data = JSON.parse(callbackInfo)
|
|
|
let id = 2
|
|
|
- mk.console.logSingle('inter ', 'onInterstitialAdShow ' + type);
|
|
|
+ mk.console.logSingle('ATInterstitialJS ', 'onInterstitialAdShow ' + type);
|
|
|
if (type == 0) {
|
|
|
id = 2
|
|
|
}
|