ESave
ESave
ESave
  • ESave Documentation
  • Pro Comparison
  • ๐Ÿ•น๏ธGetting Started
    • Installation
    • Example Scenes
    • Components
      • Save File Setup
      • Save Storage
  • ๐Ÿ“ฝ๏ธVideos
    • Tutorial
  • ๐Ÿ“„Scripting
    • Saving & Loading
      • Data Management
        • Saving
        • Loading
        • Deleting
        • Writing Changes
      • Custom Serializable Objects
      • Example Script
    • Runtime Save Creation
      • Creating a Save File
      • Infinite Saves
        • Infinite Save Scripting
    • Runtime Save Deletion
    • Understanding Background Save & Load
    • Using the Save Storage
  • ๐Ÿ› ๏ธSupport
    • Getting Help
  • ๐Ÿ“šChangelogs
    • Latest Releases
  • โญRate Me?
Powered by GitBook
On this page
  • Adding to the Storage
  • Removing From the Storage
  • Accessing the Saves
  • Get All Saves
  • Get a Save By File Name
  1. Scripting

Using the Save Storage

Scripting with the SaveStorage class.

PreviousUnderstanding Background Save & LoadNextGetting Help

Last updated 1 month ago

The save storage is unnecessary in .

The purpose of the save storage is simpleโ€”it helps find saves by storing their file path. Read more about this .

When scripting with the Save Storage, ensure that there is a Save Storage component in your scene.

Adding to the Storage

Save files that have addToStorage set to true will automatically be added to the save storage. Ensure that there is a Save Storage component in your scene. You can also add the save file to the storage with the code below.

// Where save is a SaveFile reference
SaveStorage.instance.AddSave(save);

Removing From the Storage

Removing saves from the storage is useful when you'd like the player to have the option to delete a save state.

// Where save is a SaveFile reference
SaveStorage.instance.RemoveSave(save);

Accessing the Saves

Get All Saves

You can get the list of all saves with the code below.

var allSaves = SaveStorage.instance.saves;

Get a Save By File Name

var save = SaveStorage.instance.GetSaveByFileName("name");
๐Ÿ“„
ESave Pro
here