future 1 year ago
parent
commit
5ae3d95cbc
1 changed files with 5 additions and 1 deletions
  1. 5 1
      assets/script/ui/unLock_view.ts

+ 5 - 1
assets/script/ui/unLock_view.ts

@@ -7,6 +7,7 @@ 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()
@@ -14,8 +15,11 @@ export class unLock_view extends base_ui {
         })
         let count = 0
         this.onButtonListen(this.btn_look_video, ()=>{
+            if(count>=this.max_count) {
+                return
+            }
             count++
-            this.lab_look_video.getComponent(Label).string = '看视频' + count + '/3'
+            this.lab_look_video.getComponent(Label).string = '看视频' + count + '/' + this.max_count
         })
 
         this.playBtnLookVideoAni()