Example #1
0
        private void Awake() {
            socket = GetComponent<NetSocket>();
            uiManager = GetComponent<UiManager>();

            if (socket == null || uiManager == null) {
                Debug.LogError("Missing required component.");
                return;
            }

            socket.RegisterRpcListener(this);
            socket.Events.OnConnectedToServer += ConnectedToServer;
            socket.Events.OnSocketStart += ConnectToLoginServer;
            socket.Events.OnFailedToConnect += ConnectFailed;
            socket.Events.OnDisconnectedFromServer += DisconnectedFromServer;

            Button.ListenForClick(LoginButtonName, LoginClicked);
            Button.ListenForClick(RegisterButtonName, RegisterClicked);
            TextFieldInput.ListenForSubmit(UsernameInputName, Submit);
            TextFieldInput.ListenForSubmit(PasswordInputName, Submit);
        }
Example #2
0
        private void Awake()
        {
            socket    = GetComponent <NetSocket>();
            uiManager = GetComponent <UiManager>();

            if (socket == null || uiManager == null)
            {
                Debug.LogError("Missing required component.");
                return;
            }

            socket.RegisterRpcListener(this);
            socket.Events.OnConnectedToServer      += ConnectedToServer;
            socket.Events.OnSocketStart            += ConnectToLoginServer;
            socket.Events.OnFailedToConnect        += ConnectFailed;
            socket.Events.OnDisconnectedFromServer += DisconnectedFromServer;

            Button.ListenForClick(LoginButtonName, LoginClicked);
            Button.ListenForClick(RegisterButtonName, RegisterClicked);
            TextFieldInput.ListenForSubmit(UsernameInputName, Submit);
            TextFieldInput.ListenForSubmit(PasswordInputName, Submit);
        }
Example #3
0
 private void Awake()
 {
     socket    = GetComponent <NetSocket>();
     uiManager = GetComponent <UiManager>();
     socket.RegisterRpcListener(this);
 }
Example #4
0
 private void Awake() {
     socket = GetComponent<NetSocket>();
     uiManager = GetComponent<UiManager>();
     socket.RegisterRpcListener(this);
 }