示例#1
0
文件: Login.cs 项目: mrgiang/U_Nodejs
 private void OnDestroy()
 {
     _inputUsername = null;
     _inputPassword = null;
     EventCenter.UnRegisterButtonEvent("Login-Login");
     EventCenter.UnRegisterButtonEvent("Login-Register");
     _buttonLogin    = null;
     _buttonRegister = null;
     _networkClient.Off(CmdManager.Login, SocketIOLogin);
     _networkClient.Off(CmdManager.Register, SocketIORegister);
     _networkClient.Off(CmdManager.GetRole, SocketIOGetRole);
     _networkClient = null;
 }
示例#2
0
文件: Login.cs 项目: mrgiang/U_Nodejs
    private void Start()
    {
        _networkClient = NetworkClient._instance;

        _inputUsername = transform.Find("Control - Simple Input Field - Username").GetComponent <UIInput>();
        _inputPassword = transform.Find("Control - Simple Input Field - Password").GetComponent <UIInput>();

        _buttonLogin    = EventCenter.RegisterButtonEvent("Login-Login", new Login_LoginExcute()) as Login_LoginExcute;
        _buttonRegister = EventCenter.RegisterButtonEvent("Login-Register", new Login_RegisterExcute()) as Login_RegisterExcute;

        _networkClient.On(CmdManager.Login, SocketIOLogin);
        _networkClient.On(CmdManager.Register, SocketIORegister);
        _networkClient.On(CmdManager.GetRole, SocketIOGetRole);
    }