Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 private void Awake()
 {
     socket    = GetComponent <NetSocket>();
     uiManager = GetComponent <UiManager>();
     socket.RegisterRpcListener(this);
 }
Esempio n. 4
0
 private void Awake() {
     socket = GetComponent<NetSocket>();
     uiManager = GetComponent<UiManager>();
     socket.RegisterRpcListener(this);
 }