unLock_view.ts 939 B

1234567891011121314151617181920212223242526272829303132
  1. import { _decorator, Component, Label, Node, Animation } from 'cc';
  2. import { base_ui } from '../fw/base_ui';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('unLock_view')
  5. export class unLock_view extends base_ui {
  6. @property(Node) btn_close:Node = null
  7. @property(Node) btn_look_video:Node = null
  8. @property(Node) lab_look_video:Node = null
  9. start() {
  10. this.onButtonListen(this.btn_close, ()=>{
  11. this.stopBtnLookVideoAni()
  12. this.close()
  13. })
  14. let count = 0
  15. this.onButtonListen(this.btn_look_video, ()=>{
  16. count++
  17. this.lab_look_video.getComponent(Label).string = '看视频' + count + '/3'
  18. })
  19. this.playBtnLookVideoAni()
  20. }
  21. private playBtnLookVideoAni() {
  22. this.btn_look_video.getComponent(Animation).play()
  23. }
  24. private stopBtnLookVideoAni() {
  25. this.btn_look_video.getComponent(Animation).stop()
  26. }
  27. }