public void SaveGameSelectedForWrite(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { string newFilename; mMsg = "Selected Game to save"; Debug.Log(mMsg); if (game.Filename == null || game.Filename.Length == 0) { newFilename = "UserSaved_" + DateTime.Now.ToBinary(); } else { newFilename = game.Filename; } ((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution(newFilename, DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, SavedGameOpenedForWrite); } else { mMsg = "Selection failed: " + status; Debug.LogWarning(mMsg); } }
public static void ShowSelectSnapshotUI(bool showCreateSaveUI, bool showDeleteSaveUI, int maxDisplayedSavedGames, string uiTitle, Action <SelectUIStatus, ISavedGameMetadata> cb) { using (var helperFragment = new AndroidJavaClass(HelperFragmentClass)) using (var task = helperFragment.CallStatic <AndroidJavaObject>("showSelectSnapshotUi", AndroidHelperFragment.GetActivity(), uiTitle, showCreateSaveUI, showDeleteSaveUI, maxDisplayedSavedGames)) { AndroidTaskUtils.AddOnSuccessListener <AndroidJavaObject>( task, result => { SelectUIStatus status = (SelectUIStatus)result.Get <int>("status"); Debug.Log("ShowSelectSnapshotUI result " + status); AndroidJavaObject javaMetadata = result.Get <AndroidJavaObject>("metadata"); AndroidSnapshotMetadata metadata = javaMetadata == null ? null : new AndroidSnapshotMetadata(javaMetadata, /* contents= */ null); cb.Invoke(status, metadata); }); AndroidTaskUtils.AddOnFailureListener( task, exception => { Debug.Log("ShowSelectSnapshotUI failed with exception"); cb.Invoke(SelectUIStatus.InternalError, null); }); } }
public void OnLoadGameSelected(SelectUIStatus status, ISavedGameMetadata game) { switch (status) { case SelectUIStatus.SavedGameSelected: //open the data. Player_Data_Load(); break; case SelectUIStatus.UserClosedUI: break; case SelectUIStatus.InternalError: break; case SelectUIStatus.TimeoutError: break; case SelectUIStatus.AuthenticationError: break; case SelectUIStatus.BadInputError: break; default: break; } }
public void SavedGameSelected1(SelectUIStatus _status, ISavedGameMetadata _game) { if (_status == SelectUIStatus.SavedGameSelected) { string _filename = _game.Filename; // 파일을 읽고 쓰기 전에 열어야만 한다 ((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution(_filename, DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, SavedGameOpened); if (isSaving && (_filename == null || _filename.Length == 0)) { // 새로 저장하기 _filename = "save" + DateTime.Now.ToBinary(); } if (isSaving) { // 저장하기 slot0.State = "Saving to " + _filename; Debug.Log("true"); } else { // 불러오기 slot0.State = "Loading from " + _filename; } } else { Debug.LogWarning("Error selecting save game: " + _status); } }
public static void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { if (LoadProgress) { OpenSavedGame(game.Filename); } else { Debug.Log("!! game " + game); Debug.Log("!! game name " + game.Filename); if (string.IsNullOrEmpty(game.Filename)) { var id = PlayerPrefs.GetInt(WorldConsts.CloudSaveId, 0); OpenSavedGame("game" + id); id += 1; PlayerPrefs.SetInt(WorldConsts.CloudSaveId, id); } else { OpenSavedGame(game.Filename); } } } else { Debug.Log("Saved game not selected"); } }
private void OnSavedGameSelected(SelectUIStatus arg1, ISavedGameMetadata arg2) { if (arg1 == SelectUIStatus.SavedGameSelected) { Debug.Log("Game save selected"); } else { } }
/* * Cloud loads the selected saved game. * */ public void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { GameControl.control.DoLoadFromCloud(); } else { } }
public void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save } else { // handle cancel or error } }
public void OnLoadGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save OpenSavedGameForLoad(game.Filename); } else { // handle cancel or error Debug.Log("Load game UI error"); } }
public void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save // OpenSavedGame(?); jaki filename } else { // handle cancel or error // ustawienie nowej gry od zera? } }
static void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { #if UNITY_ANDROID && !UNITY_EDITOR if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save } else { // handle cancel or error } #endif }
void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save PlatformInterface.instance.logger.LogFormat("Save game selection selected! Selected save filename: {0}", game.Filename); PlatformInterface.instance.shortMessage.Show("ERROR: Not supported", true); } else { // handle cancel or error PlatformInterface.instance.logger.LogFormat("Save game selection canceled! - {0}", status); } }
public void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save SushiDebug.LogFormat("Save game selection selected! Selected save filename: {0}", game.Filename); ShortMessage.instance.Show("ERROR: Not supported"); } else { // handle cancel or error SushiDebug.LogFormat("Save game selection canceled! - {0}", status); } //rootCanvasGroup.interactable = true; }
public void SaveGameSelectedForRead(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { mMsg = "Selected Game to load"; Debug.Log(mMsg); ((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution(game.Filename, DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, SavedGameOpenedForRead); } else { mMsg = "Selection failed: " + status; Debug.LogWarning(mMsg); } }
public void OnSavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save string fileName = game.Filename; if (String.IsNullOrEmpty(fileName)) { fileName = GenerateSaveGameName(); } OpenSavedGameForSave(fileName); } else { // handle cancel or error Debug.Log("Save game UI error"); } }
public void SavedGameSelected(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { string filename = game.Filename; Debug.Log("opening saved game: " + game); if (mSaving && (filename == null || filename.Length == 0)) { filename = "save" + DateTime.Now.ToBinary(); } //open the data. ((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution(filename, DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, SavedGameOpened); } else { Debug.LogWarning("Error selecting save game: " + status); } }
static void LoadGame(SelectUIStatus status, ISavedGameMetadata game) { if (status == SelectUIStatus.SavedGameSelected) { OpenSavedGame(game, (ISavedGameMetadata openedGame) => { if(game.Description == null || game.Description == string.Empty) { // game has not been saved on cloud before, create new file CreateNewSave(openedGame, (ISavedGameMetadata newlySavedGame) => { LoadGame(SelectUIStatus.SavedGameSelected, newlySavedGame); }); return; } // Pull the time played if (game.TotalTimePlayed != null) timePlayed = game.TotalTimePlayed; // save should be opened now Debug.Log ("Loading save from: " + openedGame.Filename + "\n" + openedGame.Description + "\nOpened = " + openedGame.IsOpen.ToString ()); m_saveBundleMetadata = openedGame; ISavedGameClient savedGameClient = PlayGamesPlatform.Instance.SavedGame; savedGameClient.ReadBinaryData(openedGame, (SavedGameRequestStatus reqStatus, byte[] data) => { Debug.Log("Reading save finished with status: " + reqStatus.ToString()); if (reqStatus == SavedGameRequestStatus.Success) { SaveDataBundle bundle = SaveDataBundle.FromByteArray(data); m_currentSaveBundle = bundle; if (OnSaveLoaded != null) { OnSaveLoaded.Invoke (bundle); OnSaveLoaded = null; } } }); }); } }
// static void DeserializeData(string data){ // string[] ListRecipes; // ListRecipes = data.Split("@"[0]); // // for(int s = 0; s < ListRecipes.Length; s++){ // // if(ListRecipes[s] != null && ListRecipes[s] != ""){ // // string recipe = ListRecipes[s]; // string recipeName = recipe.Substring(0, recipe.Length - 10); // // Debug.Log(recipeName); // int suc = int.Parse(recipe.Substring(recipe.Length - 9, 4)); // // Debug.Log(suc); // int tri = int.Parse(recipe.Substring(recipe.Length - 4, 4)); // // Debug.Log(tri); // // // if(s-1 >= GameManager.Instance.garden.Count){ // // GameManager.Instance.gardenSize++; // // GameManager.Instance.CreateParcel(GameManager.Instance.gardenSize); // // } // // // // // // GameManager.Instance.garden[s-1].GetComponent<Parcel>().SetpH(float.Parse(ph)); // // // // if(listParcel[s].Contains("pt:")){ // // // // GameManager.Instance.currentParcelGO = GameManager.Instance.garden[s-1]; // // GameManager.Instance.currentParcelGO.GetComponent<Parcel>().SetPlant(GardenManager.Instance.PlantFromString(listParcel[s].Substring(10))); // // } // } // // } // loadFinished = true; // TutorialManager.Instance.ShowNextTip(); // } static void OnSavedGameSelected (SelectUIStatus status, ISavedGameMetadata _gameMD) { if (status == SelectUIStatus.SavedGameSelected) { // handle selected game save ISavedGameClient savedGameClient = PlayGamesPlatform.Instance.SavedGame; savedGameClient.ReadBinaryData(_gameMD, OnSavedGameDataRead); } else { // handle cancel or error } }