unLock_view.ts 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { _decorator, Component, Label, Node } from 'cc';
  2. import { gameManager } from '../gameManager';
  3. const { ccclass, property } = _decorator;
  4. @ccclass('unLock_view')
  5. export class unLock_view extends Component {
  6. @property(Node) btn_close:Node = null;
  7. @property(Node) btn_video:Node = null;
  8. @property(Node) btn_video_3:Node = null;
  9. @property(Node) lab_video_3:Node = null;
  10. private m_lock_one_call = null;
  11. private m_lock_all_one_day = null;
  12. public show(lock_one_call,lock_all_one_day){
  13. this.node.active = true;
  14. this.m_lock_one_call = lock_one_call;
  15. this.m_lock_all_one_day = lock_all_one_day;
  16. this.btn_close.off(Node.EventType.TOUCH_END)
  17. this.btn_video.off(Node.EventType.TOUCH_END)
  18. this.btn_video_3.off(Node.EventType.TOUCH_END)
  19. this.btn_close.on(Node.EventType.TOUCH_END,()=>{
  20. gameManager.Singleton.sys_click_button_music()
  21. this.close()
  22. })
  23. this.btn_video.on(Node.EventType.TOUCH_END,()=>{
  24. gameManager.Singleton.sys_click_button_music()
  25. if(this.m_lock_one_call!=null){
  26. this.m_lock_one_call(this)
  27. }
  28. })
  29. this.btn_video_3.on(Node.EventType.TOUCH_END,()=>{
  30. gameManager.Singleton.sys_click_button_music()
  31. if(this.m_lock_all_one_day!=null){
  32. this.m_lock_all_one_day(this)
  33. }
  34. })
  35. this.lab_video_3.getComponent(Label).string = `开始欣赏(${gameManager.lookVideoAdsNumber}/3)`
  36. }
  37. public close(){
  38. this.node.active = false;
  39. }
  40. public updateLookVideo(){
  41. this.lab_video_3.getComponent(Label).string = `开始欣赏(${gameManager.lookVideoAdsNumber}/3)`
  42. }
  43. }