123456789101112131415161718192021222324252627282930313233343536 |
- 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
- private max_count:number = 3
- start() {
- this.onButtonListen(this.btn_close, ()=>{
- this.stopBtnLookVideoAni()
- this.close()
- })
- let count = 0
- this.onButtonListen(this.btn_look_video, ()=>{
- if(count>=this.max_count) {
- return
- }
- count++
- this.lab_look_video.getComponent(Label).string = '看视频' + count + '/' + this.max_count
- })
- this.playBtnLookVideoAni()
- }
- private playBtnLookVideoAni() {
- this.btn_look_video.getComponent(Animation).play()
- }
- private stopBtnLookVideoAni() {
- this.btn_look_video.getComponent(Animation).stop()
- }
- }
|