1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import { _decorator, Component, Label, Node } from 'cc';
- import { gameManager } from '../gameManager';
- const { ccclass, property } = _decorator;
- @ccclass('unLock_view')
- export class unLock_view extends Component {
- @property(Node) btn_close:Node = null;
- @property(Node) btn_video:Node = null;
- @property(Node) btn_video_3:Node = null;
- @property(Node) lab_video_3:Node = null;
- private m_lock_one_call = null;
- private m_lock_all_one_day = null;
- protected start(): void {
- this.btn_close.on(Node.EventType.TOUCH_END,()=>{
- gameManager.Singleton.sys_click_button_music()
- this.close()
- })
- this.btn_video.on(Node.EventType.TOUCH_END,()=>{
- gameManager.Singleton.sys_click_button_music()
- if(this.m_lock_one_call!=null){
- this.m_lock_one_call(this)
- }
- })
- this.btn_video_3.on(Node.EventType.TOUCH_END,()=>{
- gameManager.Singleton.sys_click_button_music()
- if(this.m_lock_all_one_day!=null){
- this.m_lock_all_one_day(this)
- }
- })
- }
- public show(lock_one_call,lock_all_one_day){
- this.node.active = true;
- this.m_lock_one_call = lock_one_call;
- this.m_lock_all_one_day = lock_all_one_day;
- this.lab_video_3.getComponent(Label).string = `开始欣赏(${gameManager.lookVideoAdsNumber}/3)`
- }
- public close(){
- this.node.active = false;
- }
- public updateLookVideo(){
- this.lab_video_3.getComponent(Label).string = `开始欣赏(${gameManager.lookVideoAdsNumber}/3)`
- }
- }
|