ESave
ESave Pro
ESave Pro
  • ESave Pro Documentation
  • Pro Comparison
  • 🕹️Getting Started
    • Installation
    • Demo
  • ESave Settings
  • 🧩Components
    • ESave Initializer
  • 📄Scripting
    • Initialization
    • Save Operation
    • Save States
      • Infinite Saves
        • Infinite Save Scripting
    • Saving & Loading Data
      • Saving
      • Loading
      • Custom Serializable Objects
      • Example Script
    • Data Deletion
  • 🛠️Support
    • Getting Help
  • 📚Changelogs
    • Latest Releases
  • ⭐Rate Me?
Powered by GitBook
On this page
  • Prerequisites
  • Create UI Objects
  1. Scripting
  2. Save States

Infinite Saves

Learn how to set up infinite saves for your Unity game.

PreviousSave StatesNextInfinite Save Scripting

Last updated 2 months ago

For this section, we will go through how infinite saves can be set up for your game by using the InfiniteSavesExample scene as a reference, which can be found in Assets/StylishEsper/ESave/InfiniteSavesExample.

Prerequisites

You will need some sort of UI setup that can support infinite saves. Generally, a scroll rect is required for this case. The scroll rect will be populated with save slot buttons. There should be a button for creating a new save slot—where this is located is up to you.

Create UI Objects

We will start by creating a UI button that will both load and overwrite data. This will be a prefab. You can make a prefab by dragging the object into the project window.

After that, create a button that will create save slots. This does not need to be a prefab. Both buttons will be children of the scroll rect's content for this example.

Delete the save slot button from the hierarchy, as it will be instantiated at runtime.

You will need a way to switch from loading a save to overwriting a save and vice versa. Generally, games have you navigate to a 'Load Game' section to load a game and a 'Save Game' section to overwrite a save or create a new one. For this example, we will simply be using a toggle to switch between saving and loading. Additionally, at the bottom-left, we will have a button that will delete all saves.

The data we will be saving will only be the time elapsed. So, there is a text object below the scroll rect that will display the current time elapsed.

📄