Hello,
in my game, Im using GameManager across the whole app. I want to store UserAccountInfo into property of GameManager Singleton and then be able to get the value whenever I need and If it does not exist, create it.
this is what i have, I get everytime cycled in while loop and the game shuts down (at this moment, pretend I have everytime connection to the internet and prefab api, this is my next point, prevent looping while the connection is lost)
what do you mean?
private UserAccountInfo _userAccountInfo; public UserAccountInfo UserAccountInfo { get { if (!PlayfabManager.Instance.IsClientLoggedIn()) { PlayFabLogin(); while (_userAccountInfo == null) { } } return _userAccountInfo; } set => _userAccountInfo = value; } private void PlayFabLogin() { PlayfabManager.Instance.LoginWithAndroidId(loginResult => { PlayfabManager.Instance.GetAccountInfo(accountInfoResult => { UserAccountInfo = accountInfoResult.AccountInfo; }); }); }