Example #1
0
        // SavedGameInfoUpdate is not really used on iOS.
        public void WriteSavedGameData(SavedGame savedGame, byte[] data, SavedGameInfoUpdate infoUpdate, Action <SavedGame, string> callback)
        {
            Util.NullArgumentTest(savedGame);
            Util.NullArgumentTest(data);
            Util.NullArgumentTest(callback);

            InternalSaveGameData(
                savedGame.GKSavedGame,
                data,
                (iOSGKSavedGame gkSavedGame, string error) =>
            {
                callback(gkSavedGame != null ? new SavedGame(gkSavedGame) : null, error);
            });
        }
Example #2
0
        public void WriteSavedGameData(SavedGame savedGame, byte[] data, SavedGameInfoUpdate infoUpdate, Action <SavedGame, string> callback)
        {
#if EM_GPGS
            Util.NullArgumentTest(savedGame);
            Util.NullArgumentTest(data);
            Util.NullArgumentTest(callback);

            SavedGameMetadataUpdate.Builder builder = new SavedGameMetadataUpdate.Builder();

            if (infoUpdate.IsDescriptionUpdated)
            {
                builder = builder.WithUpdatedDescription(infoUpdate.UpdatedDescription);
            }

            if (infoUpdate.IsPlayedTimeUpdated)
            {
                builder = builder.WithUpdatedPlayedTime(infoUpdate.UpdatedPlayedTime);
            }

            if (infoUpdate.IsCoverImageUpdated && infoUpdate.UpdatedPngCoverImage != null)
            {
                builder = builder.WithUpdatedPngCoverImage(infoUpdate.UpdatedPngCoverImage);
            }

            SavedGameMetadataUpdate updatedMetadata = builder.Build();

            PlayGamesPlatform.Instance.SavedGame.CommitUpdate(
                savedGame.GPGSSavedGameMetadata,
                updatedMetadata,
                data,
                (SavedGameRequestStatus status, ISavedGameMetadata game) =>
            {
                callback(game != null ? new SavedGame(game) : null,
                         status == SavedGameRequestStatus.Success ? null : status.ToString());
            }
                );
#else
            Debug.LogError(SDK_MISSING_MESSAGE);
#endif
        }
Example #3
0
 public void WriteSavedGameData(SavedGame savedGame, byte[] data, SavedGameInfoUpdate infoUpdate, Action <SavedGame, string> callback)
 {
     Debug.LogWarning(UNAVAILABLE_MESSAGE);
 }
Example #4
0
 public void WriteSavedGameData(SavedGame savedGame, byte[] data, SavedGameInfoUpdate infoUpdate, Action <SavedGame, string> callback)
 {
     Debug.LogWarning(mMessage);
 }