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

@ccclass('RefreshPage')
export class RefreshPage extends UIBase {
    useClick(){
        PlatformManager.instance.showVideoAd(()=>{
            CarColorsGlobalInstance.instance.carSysterm.refreshCar()
            CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.RefreshPage)
            CarColorsGlobalInstance.instance.roleSysterm.isGaming = true
        },()=>{
            CarColorsGlobalInstance.instance.toastSysterm.showToast("视频播放未完成！")
        })
    }
    closeClick(){
        CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.RefreshPage)
        CarColorsGlobalInstance.instance.roleSysterm.isGaming = true
    }
}


