Ejemplo n.º 1
0
        public void Load(Action <bool> onComplete)
        {
            string deviceId = Constants.GetDeviceID();

            _socket.LoginWithDeviceId(deviceId, (resp) =>
            {
                _userInfo = resp;
                Debug.Log($"userInfo => {_userInfo}");

                _socket.GetCharacters("", (characters) =>
                {
                    Debug.Log($"GetCharacters => {characters}");
                    this.characters   = characters;
                    _currentCharacter = this.characters.First();
                    onComplete?.Invoke(true);
                }, () =>
                {
                    Debug.LogError("GetCharacters failed");
                    onComplete?.Invoke(false);
                });
            },
                                      () =>
            {
                Debug.LogError("LoginWithDeviceId failed");
                onComplete?.Invoke(false);
            });
        }