unLock_view.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. protected start(): void {
  13. this.btn_close.on(Node.EventType.TOUCH_END,()=>{
  14. gameManager.Singleton.sys_click_button_music()
  15. this.close()
  16. })
  17. this.btn_video.on(Node.EventType.TOUCH_END,()=>{
  18. gameManager.Singleton.sys_click_button_music()
  19. if(this.m_lock_one_call!=null){
  20. this.m_lock_one_call(this)
  21. }
  22. })
  23. this.btn_video_3.on(Node.EventType.TOUCH_END,()=>{
  24. gameManager.Singleton.sys_click_button_music()
  25. if(this.m_lock_all_one_day!=null){
  26. this.m_lock_all_one_day(this)
  27. }
  28. })
  29. }
  30. public show(lock_one_call,lock_all_one_day){
  31. this.node.active = true;
  32. this.m_lock_one_call = lock_one_call;
  33. this.m_lock_all_one_day = lock_all_one_day;
  34. this.lab_video_3.getComponent(Label).string = `开始欣赏(${gameManager.lookVideoAdsNumber}/3)`
  35. }
  36. public close(){
  37. this.node.active = false;
  38. }
  39. public updateLookVideo(){
  40. this.lab_video_3.getComponent(Label).string = `开始欣赏(${gameManager.lookVideoAdsNumber}/3)`
  41. }
  42. }