Exemple #1
0
 /// <summary>
 /// Method for on login complete event
 /// </summary>
 /// <param name="_msg"></param>
 private void OnLoginSuccess(CallbackLoginMessage _msg)
 {
     if (_msg.IsSuccess)
     {
         EasyProfileManager.Instance.GetUserData(_callback =>
         {
             EasyProfileManager.Instance.PROFILE_CONTROLLER.CURRENT_USER_DATA = _callback.UserData;
             EasyProfileManager.Instance.VIEW_CONTROLLER.HideLogin();
             EasyProfileManager.Instance.VIEW_CONTROLLER.HideLoading();
             if (EasyProfileManager.Instance.PROFILE_SETTING.AllowToLoadScene)
             {
                 SceneManager.LoadScene(EasyProfileManager.Instance.PROFILE_SETTING.ProfileSceneName);
             }
         });
     }
     else
     {
         if (_msg.MessageCode == ProfileMessageCode.None)
         {
             PopupMessage msg = new PopupMessage();
             msg.Title   = "Error";
             msg.Message = _msg.ErrorMessage;
             EasyProfileManager.Instance.VIEW_CONTROLLER.ShowPopupMessage(msg);
             EasyProfileManager.Instance.VIEW_CONTROLLER.HideLoading();
         }
         else
         {
             EasyProfileManager.Instance.VIEW_CONTROLLER.ShowPopupMSG(ProfileMessageCode.EmailConfirm, EasyProfileManager.Instance.VIEW_CONTROLLER.ShowLogin);
             EasyProfileManager.Instance.VIEW_CONTROLLER.HideLoading();
         }
     }
 }
 private void OnUserLogined(CallbackLoginMessage _msg)
 {
     if (_msg.IsSuccess)
     {
         Debug.Log("Log in success. User id = " + _msg.UserID);
     }
     else
     {
         Debug.Log("Failed to log in " + _msg.ErrorMessage);
     }
 }
        /// <summary>
        /// Callback for login complete
        /// </summary>
        /// <param name="_msg"></param>
        public void OnLoginSuccess(CallbackLoginMessage _msg)
        {
            if (_msg.IsSuccess)
            {
                if (!string.IsNullOrEmpty(EmailInput.text) && !string.IsNullOrEmpty(PasswordInput.text) && EasyProfileManager.Instance.PROFILE_SETTING.AutoSaveUserCredentials)
                {
                    EasyProfileManager.Instance.SaveUserCredentials(_msg.Gredentials.UserLogin, _msg.Gredentials.UserPassword);
                }

                EasyProfileManager.Instance.GetUserData(_callback =>
                {
                    EasyProfileManager.Instance.PROFILE_CONTROLLER.CURRENT_USER_DATA = _callback.UserData;
                    EasyProfileManager.Instance.VIEW_CONTROLLER.HideLogin();
                    EasyProfileManager.Instance.VIEW_CONTROLLER.HideLoading();
                    if (EasyProfileManager.Instance.PROFILE_SETTING.AllowToLoadScene)
                    {
                        SceneManager.LoadScene(EasyProfileManager.Instance.PROFILE_SETTING.ProfileSceneName);
                    }
                });
            }
            else
            {
                if (_msg.MessageCode == ProfileMessageCode.None)
                {
                    PopupMessage msg = new PopupMessage();
                    msg.Title   = "Error";
                    msg.Message = _msg.ErrorMessage;
                    EasyProfileManager.Instance.VIEW_CONTROLLER.ShowPopupMessage(msg);
                    EasyProfileManager.Instance.VIEW_CONTROLLER.HideLoading();
                }
                else
                {
                    EasyProfileManager.Instance.VIEW_CONTROLLER.ShowPopupMSG(ProfileMessageCode.EmailConfirm, EasyProfileManager.Instance.VIEW_CONTROLLER.ShowLogin);
                    EasyProfileManager.Instance.VIEW_CONTROLLER.HideLoading();
                }
            }
        }
Exemple #4
0
 /// <summary>
 /// Raises a log in event
 /// </summary>
 /// <param name="_callbak">Callback response object</param>
 public void RaiseLoginActions(CallbackLoginMessage _callbak)
 {
     OnLoginActions?.Invoke(_callbak);
 }