1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import { _decorator, Component, Node, Sprite, Animation } from 'cc';
- import { tools } from '../../tools';
- import { gameManager } from '../gameManager';
- import { config } from '../../config';
- const { ccclass, property } = _decorator;
- @ccclass('win')
- export class win extends Component {
- @property(Node) btn_close:Node = null;
- @property(Node) btn_share:Node = null;
- @property(Node) btn_next:Node = null;
- @property(Node) icon:Node = null;
- private m_call_share = null;
- private m_call_next = null;
- public show(call_share,call_next){
- this.node.active = true;
- this.node.getComponent(Animation).play()
- this.m_call_next = call_next;
- this.m_call_share = call_share;
- this.btn_share.off(Node.EventType.TOUCH_END)
- this.btn_next.off(Node.EventType.TOUCH_END)
- this.btn_close.off(Node.EventType.TOUCH_END)
- this.btn_share.on(Node.EventType.TOUCH_END,()=>{
- if(this.m_call_share!=null){
- this.m_call_share()
- }
- })
- this.btn_next.on(Node.EventType.TOUCH_END,()=>{
- if(this.m_call_next!=null){
- this.m_call_next()
- }
- })
- this.btn_close.on(Node.EventType.TOUCH_END,()=>{
- this.node.active = false;
- gameManager.Singleton.backGameList(config.BACK_GAME_STATUS.WIN)
- this.icon.getComponent(Sprite).spriteFrame = null
- })
- // if(gameManager.Singleton.getLevelData()!=null){
- // tools.loadUrl(gameManager.Singleton.getLevelData().complete_img,this.icon.getComponent(Sprite))
- // }
- gameManager.Singleton.sys_success_complete_music()
- }
- }
|