Show / Hide Table of Contents

    Google Play Games - Saved Game

    This storage implementation uses Google Play Games Saved Game feature.

    • Download Google Play Games Integration
    • Google Play Games Integration Page
    • Google Play Games plugin for Unity
    • Google Play Games Services

    If you use Manual Conflict Resolution, then you would have to subscribe to the ManualConflict event of the GooglePlaySavedGameStorage to resolve conflicts manually, check the example below:

    Syntax

    googleplaygames://<Parameter Name>=<Parameter Value>; ...
    

    Or

    google-play-games://<Parameter Name>=<Parameter Value>; ...
    

    Parameters

    Name Type Description Aliases
    encoding string The text encoding text-encoding, encoding-name
    usebase64 bool Whether to use base64 encoding for strings or not use-base64
    writeuititle string Specifies the UI title for the ShowSelectSavedGameUI during the write operation write-ui-title
    readuititle string Specifies the UI title for the ShowSelectSavedGameUI during the read operation read-ui-title
    deleteuititle string Specifies the UI title for the ShowSelectSavedGameUI during the delete operation delete-ui-title
    openmode int Specifies mode for opening the Saved Games, 0 = Automatic Conflict Resolution, 1 = Show Selection UI, 2 = Manual Conflict Resolution open-mode
    datasource int Specifies the data source for Saved Games, 0 = ReadCacheOrNetwork, 1 = ReadNetworkOnly data-source
    conflictresolutionstrategy int Specifies the conflict resolution strategy to be used with Automatic conflict resolution open mode, 0 = UseLongestPlaytime, 1 = UseOriginal, 2 = UseUnmerged, 3 = UseManual, 4 = UseLastKnownGood, 5 = UseMostRecentlySaved conflict-resolution-strategy
    showcreatesaveui bool Whether to show the create save UI in saved game selection UI show-create-save-ui
    showdeletesaveui bool Whether to show the delete save UI in saved game selection UI show-delete-save-ui
    prefetchdataonconflict bool Whether to prefetch data on conflict (used for Manual Conflict Resolution) prefetch-data-on-conflict, prefetch
    maxdisplayedsavedgames int The maximum amount of displayed saved games on selection UI max-displayed-saved-games, max-displayed

    Examples

    Manual Conflict Resolution

    private void Start () {
        var settings = SaveSystemSettings.DefaultSettings;
        var savedGameStorage = (GooglePlaySavedGameStorage)settings.Storage;
    
        savedGameStorage.ManualConflict += OnConflict;
    }
    
    private void OnConflict(IConflictResolver resolver, ISavedGameMetadata original, byte[] originalData, ISavedGameMetadata unmerged, byte[] unmergedData) {
    
        // Then use the conflict resolver to choose a saved game
        resolver.ChooseMetadata(original);
    }
    
    • Improve this Doc
    • 0 Comments