import { _decorator, Component, Node } from 'cc';
import { yinyue } from './yinyue';
import { yinxiao } from './yinxiao';
import { peiyin } from './peiyin';
import { gameManager } from '../gameManager';
const { ccclass, property } = _decorator;

@ccclass('login_view')
export class login_view extends Component {
    @property(Node) btn_start:Node = null;
    @property(Node) yinyue:Node = null;
    @property(Node) yinxiao:Node = null;
    @property(Node) peiyin:Node = null;
    private m_start_game_call = null;
    public initView(start_game_call){
        this.m_start_game_call = start_game_call;
        this.btn_start.off(Node.EventType.TOUCH_END)
        this.btn_start.on(Node.EventType.TOUCH_END,()=>{
            if(this.m_start_game_call!=null){
                this.m_start_game_call()
            }
            gameManager.Singleton.sys_click_button_music()
        })
        gameManager.Singleton.getSceneManager().playMusic(gameManager.getSysData().content.sys_piped_music,true)
        this.yinyue.getComponent(yinyue).initView()
        this.yinxiao.getComponent(yinxiao).initView()
        this.peiyin.getComponent(peiyin).initView()
    }
}


