import { _decorator, Component, Label, Node, Animation } from 'cc';
import { base_ui } from '../../fw/base_ui';
const { ccclass, property } = _decorator;

@ccclass('unLock_view')
export class unLock_view extends base_ui {
    @property(Node) btn_close:Node = null
    @property(Node) btn_look_video:Node = null
    @property(Node) lab_look_video:Node = null
    start() {
        this.onButtonListen(this.btn_close, ()=>{
            this.stopBtnLookVideoAni()
            this.close()
        })
        let count = 0
        this.onButtonListen(this.btn_look_video, ()=>{
            count++
            this.lab_look_video.getComponent(Label).string = '看视频' + count + '/3'
        })

        this.playBtnLookVideoAni()
    }

    private playBtnLookVideoAni() {
        this.btn_look_video.getComponent(Animation).play()
    }

    private stopBtnLookVideoAni() {
        this.btn_look_video.getComponent(Animation).stop()
    }
}

