import { _decorator, Component, Node } from 'cc';
import { UIBase } from '../Components/UIBase';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { AdvertMgr } from 'db://assets/ScriptFrame/Frame/AdvertMgr';
const { ccclass, property } = _decorator;

@ccclass('RevivePage')
export class RevivePage extends UIBase {
    reviveClick() {
        // PlatformManager.instance.showVideoAd(()=>{
        //     CarColorsGlobalInstance.instance.roleSysterm.refreshRoleLine()
        //     CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.RevivePage)
        // },()=>{
        //     CarColorsGlobalInstance.instance.toastSysterm.showToast("视频播放未完成！")
        // })
        AdvertMgr.instance.showReawardVideo(() => {
            CarColorsGlobalInstance.instance.roleSysterm.refreshRoleLine()
            CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.RevivePage)
        })
    }
    closeClick() {
        CarColorsGlobalInstance.instance.uiSysterm.showUI(UINames.FailPage)
        CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.RevivePage)
    }
}


