Changing Storage

Save Game Pro supports variety of Storages, such as File and PlayerPrefs, you can use each one you like, or each one you need.

The Storage classes are available at BayatGames.SaveGamePro.IO namespace, here is a list of available Storage classes:

  • SaveGameFileStorage
  • SaveGamePlayerPrefsStorage

Now, you can change the storage by using SaveGameSettings Storage property:

// Create custom settings with custom storage
SaveGameSettings settings = new SaveGameSettings ();
settings.Storage = new BayatGames.SaveGamePro.IO.SaveGameFileStorage ();

// Pass it as argument to SaveGame API
SaveGame.Save ( "helloWorld", "Hello World", settings );

// Or Update the Default Settings
SaveGame.DefaultSettings = settings;

Note: If you change the storage, then the saved data on the previous storage cannot be loaded, that means you can’t load the saved data on the File Storage when you are using PlayerPrefs Storage.