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