private void HandleSyncSuccess(object sender, SyncSuccessEvent e) { var dataset = sender as Dataset; if (dataset.Metadata != null) { Debug.Log("Successfully synced for dataset: " + dataset.Metadata); } else { Debug.Log("Successfully synced for dataset"); } if (dataset == playerInfo) { alias = string.IsNullOrEmpty(playerInfo.Get("alias")) ? "Enter your alias" : dataset.Get("alias"); playerName = string.IsNullOrEmpty(playerInfo.Get("playerName")) ? "Enter your name" : dataset.Get("playerName"); } statusMessage = "Syncing to CognitoSync Cloud succeeded"; }
private void HandleSyncSuccess(object sender, SyncSuccessEvent e) { if (mergeInCourse) { Debug.Log ("Waiting for merge to complete to sync again"); return; } var dataset = sender as Dataset; if (dataset != null && dataset.Metadata != null) { Debug.Log("Successfully synced for dataset : " + dataset.Metadata.DatasetName); } else { //In case we called synchronize after deleting the dataset, we can not access it anymore Debug.Log("Successfully synced dataset"); } //Note: Cleanup added for compatibility with datasets created with old versions of the sample foreach (string key in dataset.GetAll().Keys) { if (key.Length < 3) { dataset.Remove(key); } } IDictionary<string, string> dic = dataset.GetAll (); string[] characterStrings = new string[dic.Count]; dic.Values.CopyTo(characterStrings, 0); CharacterList charList = GetComponent<CharacterList> (); charList.DeserializeCharacters (characterStrings); GetComponent<CharacterList> ().enabled = true; //Enable GUI }