Exemplo n.º 1
0
        private async void CreateUser()
        {
            LoadingBarEnable(true);

            var credentials = new Credentials {
                UserId = loginCreateInput.text, Password = passwordCreateInput.text
            };
            var res = await NetworkProvider.CreateUser(credentials);

            LoadingBarEnable(false);

            if (res.IsError)
            {
                ShowInfo(res.ErrorMessage);
                return;
            }

            switch (res.Value.Status)
            {
            case Status.Ok:
                createUserButton.transform.parent.gameObject.SetActive(false);
                break;

            case Status.LogInInUse:
                ShowInfo("This name is already used");
                break;
            }
        }