private static void OnReadBinaryData(SavedGameRequestStatus status, byte[] data) { Debug.Log("(Color Snipers U) Saved Game Binary Read: " + status.ToString()); if (status == SavedGameRequestStatus.Success) { try { readData = data; if (isSaving) { WriteSavedGame(writeData); } } catch (Exception e) { Debug.Log("(Color Snipers U) Saved Game Write: convert exception"); } } }
/// <summary> /// Prepare retreived data from GPGS saved game to be applied /// </summary> /// <param name="status">Status.</param> /// <param name="data">Data.</param> static void OnSavedGameDataRead (SavedGameRequestStatus status, byte[] data) { UIManager.Notify("game data read status " + status.ToString()); if (status == SavedGameRequestStatus.Success) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Create(Application.persistentDataPath + "retreivedGPGS.dat"); File.WriteAllBytes(Application.persistentDataPath + "retreivedGPGS.dat", data); PlayerData _playerData = (PlayerData)bf.Deserialize(file); ApplyRetreivedPlayerData(_playerData); UIManager.DisplaySaveState(UIManager.SaveState.loadOnline); } }
public void OnSavedGameWritten(SavedGameRequestStatus status, ISavedGameMetadata game) { Debug.Log($"OnSavedGameWritten {status.ToString()}"); isSaving = false; UserDataControl.Instance.isSaving = false; }
private static void OnWriteSavedGames(SavedGameRequestStatus status, ISavedGameMetadata game) { Debug.Log("(Color Snipers U) Saved Game Write: " + status.ToString()); }