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';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
const { ccclass, property } = _decorator;

@ccclass('SortPage')
export class SortPage extends UIBase {
    useClick(){
        AudioManager.instance.playOneShot(AudioClipNames.button_ok)
        PlatformManager.instance.showVideoAd(()=>{
            CarColorsGlobalInstance.instance.roleSysterm.refreshRoleLine()
            CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.SortPage)
            CarColorsGlobalInstance.instance.roleSysterm.isGaming = true
            AudioManager.instance.playOneShot(AudioClipNames.upgrade)
        },()=>{
            CarColorsGlobalInstance.instance.toastSysterm.showToast("视频播放未完成！")
        })
    }
    closeClick(){
        AudioManager.instance.playOneShot(AudioClipNames.button_ok)
        CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.SortPage)
        CarColorsGlobalInstance.instance.roleSysterm.isGaming = true
    }
}


