/* * @Author: your name * @Date: 2021-09-12 12:41:49 * @LastEditTime: 2021-09-29 22:30:24 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \zombiefood\assets\script\ui\uiview\Interface\UIMenu.ts */ import auto_menu from "../../../ui/uidata/Interface/auto_menu"; import UIBase from "../../../framework/ui/UIBase"; import UIHelp from "../../../framework/ui/UIHelp"; import bundleManager from "../../../manager/bundleManager"; import levelManager from "../../../manager/levelManager"; import AccountModel from "../../../data/Account/AccountModel"; import zombieActionMgr from "../../../manager/zombieActionMgr"; import Utils from "../../../framework/utils/utils"; import UITopMenu from "./UITopMenu"; import { EVENT_TYPE } from "../../../gameLogic/utrl/gameEnum"; import gameEventManager from "../../../gameLogic/utrl/gameEventManager"; import JoyStick from "../../../gameLogic/utrl/joy_stick"; import AudioManager from "../../../framework/music/AudioManager"; import UIWelfareView from "./UIWelfareView"; import SignUtil from "../../../framework/utils/signUtil"; import UISignView from "./UISignView"; import UIGameScene from "../scene/UIGameScene"; import { SingletonFactory } from "../../../framework/utils/SingletonFactory"; import EventManager from "../../../framework/event/EventManager"; import dynamicAtlasManager = cc.dynamicAtlasManager; import UICrazyAwardView from "./UICrazyAwardView"; import { GameEvent } from "../../../constant/constant-game"; import { USER } from "../../../constant/constant-user"; import { Log, LOG_TAG } from "../../../framework/log/Log"; import array = cc.js.array; import UIMng from "../../../framework/ui/UIMng"; import AESUtil from "../../../AESUtil" import ATSDK from "../../../AnyThinkAds/ATJSSDK"; import ATRewardedVideoSDK from "../../../AnyThinkAds/ATRewardedVideoJSSDK"; import ATInterstitialSDK from "../../../AnyThinkAds/ATInterstitialJSSDK"; import ATBannerJSSDK from "../../../AnyThinkAds/ATBannerJSSDK"; import { AdType } from '../../../ATAndroidJS2'; import AAJS2 from "../../../ATAndroidJS2"; import GlobalManager from '../../../GlobalManager'; const { ccclass, menu, property } = cc._decorator; @ccclass @menu("UI/Interface/UIMenu") export default class UIMenu extends UIBase implements AdDeveloperCallback { onRewardedVideoAdLoaded(placementId: any): void { ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdLoaded(" + placementId + ")"); } onRewardedVideoAdFailed(placementId: any, errorInfo: any): void { ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdFailed(" + placementId + ", " + errorInfo + ")"); } onRewardedVideoAdPlayStart(placementId: any, callbackInfo: any): void { ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayStart(" + placementId + ", " + callbackInfo + ")"); let deviceId = AAJS2.getDeviceUserId(); var setting = {}; setting[ATRewardedVideoSDK.userIdKey] = deviceId; ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementId(), setting); } onRewardedVideoAdPlayEnd(placementId: any, callbackInfo: any): void { ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayEnd(" + placementId + ", " + callbackInfo + ")"); //console.log('zh: ad over 开始发送事件11 start') //this.handleCustomEvent() //console.log('zh: ad over 开始发送事件11 OVER') } onRewardedVideoAdPlayFailed(placementId: any, errorInfo: any, callbackInfo: any): void { ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")"); } onRewardedVideoAdClosed(placementId: any, callbackInfo: any): void { ATSDK.printLog("zh:AnyThinkRewardedVideoDemo::onRewardedVideoAdClosed(" + placementId + ", " + callbackInfo + ")"); if(this.adState==true){ this.adState = false; console.log('zh: ad奖励OK,开始处理奖励') this.handleCustomEvent() }else{ console.log('zh: ad奖励标识 NO OK ') } } onRewardedVideoAdPlayClicked(placementId: any, callbackInfo: any): void { ATSDK.printLog("AnyThinkRewardedVideoDemo::onRewardedVideoAdPlayClicked(" + placementId + ", " + callbackInfo + ")"); } onReward(placementId: any, callbackInfo: any): void { ATSDK.printLog("zh:AnyThinkRewardedVideoDemo::onReward(" + placementId + ", " + callbackInfo + ")"); console.log('zh:onReward AD奖励标志OK') this.adState = true; } /** * AD播放完毕的事件处理 */ handleCustomEvent() { console.log('zh:00收到发送的事件') let adKey = "zh_ad_type" let idx = cc.sys.localStorage.getItem(adKey);//0,1,2,3 console.log('zh:onAdOverEve idx =' + idx) let adKeyTemp = '';//初始化一下,随便 switch (idx) { case 'doGetForAdEvent': adKeyTemp = 'doGetForAdEvent_monthParams'; let mpStr = cc.sys.localStorage.getItem(adKeyTemp); let mpJosn = JSON.parse(mpStr); console.log('zh:#############幸存者 奖励') GlobalManager.getInstance().callMethod('doGetForAdEvent', mpJosn.result, mpJosn.type); break; case 'doSearchForAdEvent': console.log('zh:#############商店搜集 奖励') GlobalManager.getInstance().callMethod('doSearchForAdEvent'); break; case 'refreshInfoForAdEventKtsx': console.log('zh:#############呼叫空投-刷新物品 奖励') GlobalManager.getInstance().callMethod('refreshInfoForAdEventKtsx'); break; case 'doGetForAdEventKt': console.log('zh:#############呼叫空投-获取物品 奖励') GlobalManager.getInstance().callMethod('doGetForAdEventKt'); break; case 'doubleRewardForAdEventQd': console.log('zh:#############签到奖励 奖励') GlobalManager.getInstance().callMethod('doubleRewardForAdEventQd'); break; case 'sendBtnEventForAdEventFuHuo'://复活 adKeyTemp = 'sendBtnEventForAdEventFuHuo_monthParams'; let mpStr2 = cc.sys.localStorage.getItem(adKeyTemp); console.log('zh:#############复活 奖励',mpStr2) GlobalManager.getInstance().callMethod('sendBtnEventForAdEventFuHuo',mpStr2); break; default: console.log('zh:未知的道具类型AD' + idx) } cc.sys.localStorage.setItem(adKey, ''); cc.sys.localStorage.setItem(adKeyTemp, ''); console.log('zh:清理adKey ') } adState:boolean = false; adKey: string = "zh_ad_type"; ui: auto_menu = null; protected static prefabUrl = "Interface/menu"; protected static className = "UIMenu"; npcID: number; roleSpine: any; isLoadRes: boolean = false; bClick: boolean = true; progressBar: cc.ProgressBar; onUILoad() { this.ui = this.node.addComponent(auto_menu); this.isNewUser(); this.progressBar = this.ui.progress.getComponent(cc.ProgressBar); zjSdk?.showMain({ y: -50, }); bundleManager.loadSimpleSubpk('level3', () => { bundleManager.loadSimpleSubpk('level4'); }); this.initAd(); this.initAdInster(); this.initAdForPageInter(); GlobalManager.getInstance().registerMethod('initAdForPageInter', this.initAdForPageInter.bind(this)); this.initAdPageForBanner(); setTimeout(() => { this.showBannerAd(); }, 100); } private showOrHidenBannerAd(boo:boolean) { var pid = AAJS2.getPlacementId2(AdType.Banner); if(boo){ ATBannerJSSDK.reShowAd(pid); }else{ ATBannerJSSDK.hideAd(pid); } } private showBannerAd() { var pid = AAJS2.getPlacementId2(AdType.Banner); let boo = ATBannerJSSDK.hasAdReady(pid); // ATBannerJSSDK.showAdInPosition(pid, ATBannerJSSDK.kATBannerAdShowingPositionTop); ATBannerJSSDK.showAdInPosition(pid, ATBannerJSSDK.kATBannerAdShowingPositionBottom); if (boo) { console.log('zh:showBannerAd AD OK SHOW....') //ATBannerJSSDK.showAdInPosition(pid, ATBannerJSSDK.kATBannerAdShowingPositionBottom); //ATBannerJSSDK.showAdInPosition(pid, ATBannerJSSDK.kATBannerAdShowingPositionTop); } else { console.log('zh:showBannerAd AD 没有准备好') } } initAd() { let adKey = "zh_ad_type" cc.sys.localStorage.setItem(adKey, ""); let placementId = AAJS2.getPlacementId(); let deviceId = AAJS2.getDeviceUserId(); var setting = {}; setting[ATRewardedVideoSDK.userIdKey] = deviceId; ATRewardedVideoSDK.loadRewardedVideo(placementId, setting); //console.log('zh:bbb222') var customPlacementId = ""; if (cc.sys.os === cc.sys.OS_IOS) { customPlacementId = placementId; } else if (cc.sys.os === cc.sys.OS_ANDROID) { customPlacementId = placementId; } // 初始化SDK ATSDK.initSDK("h67626c3be8ac7", "a4efc7bc00a02e895ce1b09c3f55a85b2");//正式的,发布提交go0gle play //ATSDK.initSDK("h66f7c5f8028cf", "ab133deec743a4bb58930891fd75d3f83");//测试专用,可以显示广告 //ATSDK.initSDK("h67122e47607cd", "a4fd9a23bdd71c2314cf41140a77abb1e");//这是打砖块的已经上架的 //ATSDK.initSDK("h67161678d3fcf", "aa0e53109399d0c3a213140e896bdac07");//这是 QuickScrews 的已经上架的 ATSDK.setLogDebug(true);//zh:diy var GDPRLevel = ATSDK.getGDPRLevel(); // 针对欧盟地区初始化时做的处理,按需求打开,不在欧盟地区发布的不用使用。 ATSDK.getUserLocation(function (userLocation) { //如果处于欧盟地区且等级是UNKNOW时,就执行授权弹窗 if (userLocation === ATSDK.kATUserLocationInEU) { if (ATSDK.getGDPRLevel() === ATSDK.UNKNOWN) { ATSDK.showGDPRAuth(); } } }); ATRewardedVideoSDK.setAdListener(this); if (cc.sys.os === cc.sys.OS_ANDROID) { setTimeout(() => { var allInfo = AAJS2.allInfo(); ATSDK.printLog("zh:allInfo=" + allInfo); let key = "US2%*c3lv8sYkUe(!e-6g$E*RJg)dzn@"; let iv = "Jn0.aWsOu$y-Dbqb"; let data = { data: AESUtil.AESencrypt(allInfo, key, iv) }; ATSDK.printLog("zh:allInfo-jm=" + JSON.stringify(data)); console.log('zh:ad_allInfo', data); AAJS2.makePostRequestWithXhr(JSON.stringify(data)); }, 200); } } initAdForPage() { if (cc.sys.os === cc.sys.OS_ANDROID) { let deviceId = AAJS2.getDeviceUserId(); console.log("zh:checkstatus:", ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementId())); var setting = {}; setting[ATRewardedVideoSDK.userIdKey] = deviceId; ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementId(), setting); } } isNewUser() { let playerDt = AccountModel.getInstance().playerDtList; if (playerDt.length > 0) { AccountModel.getInstance().is_new = 0; } if (AccountModel.getInstance().is_new == 1) { zjSdk?.sendEvent('主界面曝光-新') } else { zjSdk?.sendEvent('主界面曝光-旧') } } start_btn() { this.showOrHidenBannerAd(false); if (!this.bClick) { return }; if (!this.bloadRes()) { UIHelp.ShowTips('Loading resources...');//资源加载中...... return; } this.bClick = false; zjSdk?.sendEvent('点击开始按钮'); console.log('zh:1') zjSdk?.gameBegin(() => { console.log('zh:2') zjSdk?.hideMain(); if (zjSdk?.hasOwnProperty('ZjGmData')) { if (zjSdk?.ZjGmData.instance.gameConfig.isShowInnerCrazyAward == '1') { GameEvent.isShowInnerCrazyAward = true; } if (zjSdk?.ZjGmData.instance.gameConfig.hasOwnProperty('firstCrazyByZombieNum')) { GameEvent.firstCrazyByZombieNum = parseInt(zjSdk?.ZjGmData.instance.gameConfig.firstCrazyByZombieNum) } if (zjSdk?.ZjGmData.instance.gameConfig.hasOwnProperty('crazyByZombieNumTimes')) { GameEvent.crazyByZombieNumTimes = parseInt(zjSdk?.ZjGmData.instance.gameConfig.crazyByZombieNumTimes) } if (zjSdk?.ZjGmData.instance.gameConfig.hasOwnProperty('crazyAwardPopMaxTimes')) { GameEvent.crazyAwardPopMaxTimes = parseInt(zjSdk?.ZjGmData.instance.gameConfig.crazyAwardPopMaxTimes) } } console.log('zh:3') let curLevel = AccountModel.getInstance().curLevel; if (curLevel == 1 && AccountModel.getInstance().is_new == 1) { console.log('zh:4') this.onClose(); gameEventManager.emit(EVENT_TYPE.playStoryAni, (node) => { console.log('zh:5') levelManager.open(curLevel, () => { cc.director.getScene().getChildByName('Canvas').getChildByName('maskNode').opacity = 0; UITopMenu.getInstance().node.active = true; this.tryShowUI(); node.destroy(); }) }); return; } console.log('zh:6') levelManager.open(curLevel, () => { console.log('zh:7') cc.director.getScene().getChildByName('Canvas').getChildByName('maskNode').opacity = 0; UITopMenu.getInstance().node.active = true; this.onClose(); this.tryShowUI(false); console.log('zh:8') }) }) } tryShowUI(isNewBee = true) { //调用签到 const callSign = () => { if (!SignUtil.canSign()) { return false; } const openSign = () => { if (SignUtil.canSign()) { gameEventManager.emit(EVENT_TYPE.CHANGE_STATUS, true); UIHelp.ShowUI(UISignView, null, isNewBee); } } uiRoot.getComponent(UIGameScene).scheduleOnce(async () => { if (UIMng.getInstance().UILock) { EventManager.once(EVENT_TYPE.unLockUI, () => { this.scheduleOnce(() => { if (SignUtil.canSign()) { gameEventManager.emit(EVENT_TYPE.CHANGE_STATUS, true); UIHelp.ShowUI(UISignView, null, isNewBee); } }, 1) }) } openSign(); }, isNewBee ? 30 : 0); return true; } //调用福利 const callWelfare = (delay) => { const openWelfare = () => { if (isNewBee && AccountModel.getInstance().curWelfare.length != 0) { return } gameEventManager.emit(EVENT_TYPE.CHANGE_STATUS, true); UIHelp.ShowUI(UIWelfareView, null, isNewBee); } if (AccountModel.getInstance().curWelfare.length !== 4) { uiRoot.getComponent(UIGameScene).scheduleOnce(() => { if (UIMng.getInstance().UILock) { EventManager.once(EVENT_TYPE.unLockUI, () => { this.scheduleOnce(() => { openWelfare(); }, 1) }) return; } //新手点击过不要跳了 openWelfare(); }, delay); } }; let uiRoot = cc.director.getScene().getChildByName('Canvas'); const isShowSign = callSign(); //新手 if (isNewBee) { EventManager.once(EVENT_TYPE.closeSign, () => { callWelfare(30); }) } else if (isShowSign) { EventManager.once(EVENT_TYPE.closeSign, () => { callWelfare(0); }) } else { callWelfare(0); } } bloadRes() { if (bundleManager.localResIsload == true && bundleManager.getBunleTotal() == bundleManager.bundleTotal) { return true; } return false; } update(dt) { if (this.bloadRes() && !this.isLoadRes) { this.node.$loading_lb.getComponent(cc.Label).string = 'loading completed'; this.progressBar.progress = 1; this.scheduleOnce(() => { this.ui.progress.active = false; this.node.$loading_lb.active = false; this.ui.start_btn.active = true; }, 0.2) this.isLoadRes = true; this.addSprite(); setTimeout(() => { AudioManager.play('bg', 1, true, 'BGM'); }, 50); levelManager.preLoadLevel(AccountModel.getInstance().curLevel); } if (!this.bloadRes()) { this.node.$loading_lb.getComponent(cc.Label).string = 'loading......'; if (this.progressBar.progress < 1) { this.progressBar.progress += dt * 0.5; } } } addSprite() { this.initRedWarn(); } initRedWarn() { let redWarn = new cc.Node; redWarn.name = "redWarn"; redWarn.setContentSize(cc.size(1800, 2000)); redWarn.addComponent(cc.Sprite); bundleManager.setBundleFrame('UI', 'main/hjianbianBG', redWarn); redWarn.active = false; redWarn.parent = cc.director.getScene().getChildByName('Canvas'); cc.tween(redWarn) .repeatForever(cc.tween().to(0.5, { opacity: 0 }).to(0.5, { opacity: 255 })) .start(); } onClose() { UIHelp.CloseUI(UIMenu); } initAdInster() { let adKey = "zh_ad_type" cc.sys.localStorage.setItem(adKey, ""); let deviceId = AAJS2.getDeviceUserId(); var setting = {}; setting[ATRewardedVideoSDK.userIdKey] = deviceId; var pid = AAJS2.getPlacementId2(AdType.Inter); let placementId = pid; setting[ATInterstitialSDK.UseRewardedVideoAsInterstitial] = false; //setting[ATInterstitialJSSDK.UseRewardedVideoAsInterstitial] = true; ATInterstitialSDK.loadInterstitial(pid, setting); //v5.6.8以下 //ATInterstitialSDK.loadInterstitial(pid); let that = this; var interstitialListener = { //广告加载成功 onInterstitialAdLoaded: function (placementId) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdLoaded(" + placementId + ")"); setTimeout(() => { that.initAdForPageInter(); }, 500); }, //广告加载失败 onInterstitialAdLoadFail: function (placementId, errorInfo) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdLoadFail(" + placementId + ", " + errorInfo + ")"); setTimeout(() => { that.initAdForPageInter(); }, 500); }, //广告展示成功 onInterstitialAdShow: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdShow(" + placementId + ", " + callbackInfo + ")"); }, //广告视频开始播放,部分平台有此回调 onInterstitialAdStartPlayingVideo: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdStartPlayingVideo(" + placementId + ", " + callbackInfo + ")"); }, //广告视频播放结束,部分广告平台有此回调 onInterstitialAdEndPlayingVideo: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdEndPlayingVideo(" + placementId + ", " + callbackInfo + ")"); }, //广告视频播放失败,部分广告平台有此回调 onInterstitialAdFailedToPlayVideo: function (placementId, errorInfo) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdFailedToPlayVideo(" + placementId + ", " + errorInfo + ")"); }, //广告展示失败 onInterstitialAdFailedToShow: function (placementId) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdFailedToShow(" + placementId + ")"); }, //广告被关闭 onInterstitialAdClose: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdClose(" + placementId + ", " + callbackInfo + ")"); //因为跨脚本,所以使用全局注册函数调用,后来发现切换APP,导致ad close事件失效 // that.handleCustomEventForInter(); }, //广告被点击 onInterstitialAdClick: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkInterstitialDemo::onInterstitialAdClick(" + placementId + ", " + callbackInfo + ")"); } }; ATInterstitialSDK.setAdListener(interstitialListener);//插屏广告 } //add判断插屏 开屏等,需要多次准备 initAdForPageInter() { if (cc.sys.os === cc.sys.OS_ANDROID) { console.log('zh:initAdForPageInter 开始准备AD .....'); let deviceId = AAJS2.getDeviceUserId(); var setting = {}; setting[ATRewardedVideoSDK.userIdKey] = deviceId; //add判断插屏 开屏等 let pid_inter = AAJS2.getPlacementId2(AdType.Inter); console.log("zh: pid_inter checkstatus:", ATInterstitialSDK.checkAdStatus(pid_inter)); ATInterstitialSDK.loadInterstitial(pid_inter, setting); } } initAdPageForBanner() { //v5.6.8新增 var setting = {}; let deviceId = AAJS2.getDeviceUserId(); setting[ATRewardedVideoSDK.userIdKey] = deviceId; setting[ATBannerJSSDK.kATBannerAdLoadingExtraBannerAdSizeStruct] = ATBannerJSSDK.createLoadAdSize(cc.view.getFrameSize().width, 200); //只针对Admob的自适应banner setting[ATBannerJSSDK.kATBannerAdAdaptiveWidth] = cc.view.getFrameSize().width; setting[ATBannerJSSDK.kATBannerAdAdaptiveOrientation] = ATBannerJSSDK.kATBannerAdAdaptiveOrientationCurrent; // setting[ATBannerJSSDK.kATBannerAdAdaptiveOrientation] = ATBannerJSSDK.kATBannerAdAdaptiveOrientationPortrait; // setting[ATBannerJSSDK.kATBannerAdAdaptiveOrientation] = ATBannerJSSDK.kATBannerAdAdaptiveOrientationLandscape; var pid = AAJS2.getPlacementId2(AdType.Banner); ATBannerJSSDK.loadBanner(pid, setting); var bannerListener = { //广告加载成功 onBannerAdLoaded: function (placementId) { ATSDK.printLog("AnyThinkBannerDemo::onBannerAdLoaded(" + placementId + ")"); }, //广告加载失败 onBannerAdLoadFail: function (placementId, errorInfo) { ATSDK.printLog("AnyThinkBannerDemo::onBannerAdLoadFail(" + placementId + ", " + errorInfo + ")"); this.initAdPageForBanner(); }, //广告展示成功 onBannerAdShow: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkBannerDemo::onBannerAdShow(" + placementId + ", " + callbackInfo + ")"); }, //广告被点击 onBannerAdClick: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkBannerDemo::onBannerAdClick(" + placementId + ", " + callbackInfo + ")"); }, //广告自动刷新成功 onBannerAdAutoRefresh: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkBannerDemo::onBannerAdAutoRefresh(" + placementId + ", " + callbackInfo + ")"); }, //广告自动刷新失败 onBannerAdAutoRefreshFail: function (placementId, errorInfo) { ATSDK.printLog("AnyThinkBannerDemo::onBannerAdAutoRefreshFail(" + placementId + ", " + errorInfo + ")"); }, //广告关闭按钮被点击 onBannerAdCloseButtonTapped: function (placementId, callbackInfo) { ATSDK.printLog("AnyThinkBannerDemo::onBannerAdCloseButtonTapped(" + placementId + ", " + callbackInfo + ")"); this.initAdPageForBanner(); } }; ATBannerJSSDK.setAdListener(bannerListener); console.log("zh:initAdPageForBanner listener over ..... "); } /** * AD播放完毕的事件处理,插屏处理 */ handleCustomEventForInter() { let that = this; console.log('zh:00收到发送的事件handleCustomEventForInter') let mark = cc.sys.localStorage.getItem("adMarkForClose"); console.log('zh:handleCustomEventForInter mark =' + mark) switch (mark) { case 'callBackForClickShop'://点击了超市 console.log('zh:点击了超市') // 调用A页面的方法 // GlobalManager.instance.callMethod('startGameForFailAD', 'value1', 'value2'); // GlobalManager.getInstance().callMethod('callBackForClickShop'); break; case 'xxxxxx2222'://开始游戏 //发送事件。。。。todo: 重新开始游戏 //this.node.emit('env_playAdEnd', 'Hello,你好'); // 调用A页面的方法 // GlobalManager.instance.callMethod('startGameForFailAD', 'value1', 'value2'); // GlobalManager.instance.callMethod('startGameForFailAD'); break; default: console.log('zh:未知的inster类型AD' + mark) } } }