import { ryw_Event } from "../FrameWork/Event/EventEnum"; import EventMgr from "../FrameWork/Event/EventMgr"; import GameReport, { ENTERTYPE, OUTTYPE } from "../FrameWork/Report/ZyZyReport"; import User from "../FrameWork/User/User"; import AppPlatform from "../FrameWork/Util/AppPlatform"; import Utilit from "../FrameWork/Util/Utilit"; import Common5 from "../Platform/th/Common5"; import TTAPI from "../Platform/tt/TTAPI"; import Game from "../Scripts/Game"; import PhysicalPowerManger from "../ttFrame/manager/PhysicalPowerManger"; const { ccclass, property } = cc._decorator; @ccclass export default class GameFailUITimeOut extends cc.Component { @property(cc.Node) protected btnRestart: cc.Node = null; @property(cc.Node) protected btnBack: cc.Node = null; @property(cc.RichText) timeLabel: cc.RichText = null; protected start(): void { TTAPI.stopRecord_custom(); // Common5.stopMusic(); Common5.playEffect("fail"); Common5.stopMusic(); // Common5.playMusic("bg"); this.btnRestart.on("click", () => { let tab = { onClose: (finish) => { if (finish) { // Common5.selectGameNum = this.level; if(Common5.selectGameInfo){ GameReport.ADReport('我要加时',Common5.selectGameInfo.title2,1) Common5.ReportDY("inLevel", Common5.selectGameInfo.title2 + "-AD-我要加时"); } EventMgr.emitEvent_custom(ryw_Event.game_continue); this.node.removeFromParent(); } else { GameReport.ADReport('我要加时',Common5.selectGameInfo.title2,0) Common5.showTips_custom("广告未观看完"); } this.node.removeFromParent(); }, onFailed: () => { } } AppPlatform.playVideo_custom(tab); }, this); this.btnBack.on("click", () => { this.btnBackFunc(); }, this); if (this.timeLabel != null){ this.timeLabel.string = "还差一点就成功了\r\n看个视频立即加"+Common5.selectGameInfo.timeInit+"秒" } } btnBackFunc() { Game.ins.clickBackTimeOut(null,true); GameReport.OUTReport(OUTTYPE.SHIBAI,Common5.selectGameInfo.title2) this.node.removeFromParent(); } }