コード例 #1
0
        protected virtual void OnUserDataComplete(GetUserDataResult result)
        {
            Debug.Log("MetaLoopGameManager User Data downloaded...");

            if (result != null && result.Data.ContainsKey(MetaStateSettings._MetaDataStateFileName) && !string.IsNullOrEmpty(result.Data[MetaStateSettings._MetaDataStateFileName].Value))
            {
                //being able to retreive userData confirm that user can't be a new user.
                IsNewInstall = false;

                MetaDataStateBase onlineData = (MetaDataStateBase)JsonConvert.DeserializeObject(result.Data[MetaStateSettings._MetaDataStateFileName].Value, MetaStateSettings.PolymorhTypes[typeof(MetaDataStateBase)]);

                if (onlineData.Version > GameData.Current.MetaDataState.Version || forceCloudVersionFromAccountSync)
                {
                    MetaDataStateBase.LoadData(onlineData);
                    GameData.Current.OverwriteMetaDataState(onlineData);
                }
                else
                {
                    MetaDataStateBase.LoadData(GameData.Current.MetaDataState);
                }
            }
            else
            {
                MetaDataStateBase.LoadData(GameData.Current.MetaDataState);
            }

            OnGameDataAndBackOfficeReady();
        }
コード例 #2
0
        protected virtual void OnUserDataComplete(GetUserDataResult result)
        {
            Debug.Log("MetaLoopGameManager User Data downloaded...");

            if (result != null && result.Data.ContainsKey(MetaStateSettings._MetaDataStateFileName))
            {
                var gameDataObject = JsonConvert.DeserializeObject(result.Data[MetaStateSettings._MetaDataStateFileName].Value, MetaStateSettings.PolymorhTypes[typeof(MetaDataStateBase)]);
                MetaDataStateBase.LoadData((MetaDataStateBase)gameDataObject);

                OnGameDataAndBackOfficeReady();
            }
            else
            {
                ShowUnavailableMessage(GameUnavailableMessageType.BACKOFFICE_ERROR);
            }
        }
コード例 #3
0
 protected virtual void OnPlayFabLoginFailed(PlayFabError obj)
 {
     IsOfflineMode = true;
     MetaDataStateBase.LoadData(GameData.Current.MetaDataState);
     OnGameDataAndBackOfficeReady();
 }