public static void RefreshStudiosList(bool onlyIfNull = false) { if (string.IsNullOrEmpty(PlayFabEditorPrefsSO.Instance.DevAccountToken)) { return; // Can't load studios when not logged in } if (onlyIfNull && PlayFabEditorPrefsSO.Instance.StudioList != null) { return; // Don't spam load this, only load it the first time } if (PlayFabEditorPrefsSO.Instance.StudioList != null) { PlayFabEditorPrefsSO.Instance.StudioList.Clear(); } PlayFabEditorApi.GetStudios(new GetStudiosRequest(), (getStudioResult) => { if (PlayFabEditorPrefsSO.Instance.StudioList == null) { PlayFabEditorPrefsSO.Instance.StudioList = new List <Studio>(); } foreach (var eachStudio in getStudioResult.Studios) { PlayFabEditorPrefsSO.Instance.StudioList.Add(eachStudio); } PlayFabEditorPrefsSO.Instance.StudioList.Add(Studio.OVERRIDE); PlayFabEditorPrefsSO.Save(); }, PlayFabEditorHelper.SharedErrorCallback); }
public static void RefreshStudiosList() { if (AccountDetails.studios != null) { AccountDetails.studios.Clear(); } PlayFabEditorApi.GetStudios(new GetStudiosRequest(), (getStudioResult) => { if (AccountDetails.studios == null) { AccountDetails.studios = new List <Studio>(); } foreach (var eachStudio in getStudioResult.Studios) { AccountDetails.studios.Add(eachStudio); } AccountDetails.studios.Add(Studio.OVERRIDE); SaveAccountDetails(); }, PlayFabEditorHelper.SharedErrorCallback); }