> For the complete documentation index, see [llms.txt](https://apex-studio.gitbook.io/apex-secure-vault-official-documentation./llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://apex-studio.gitbook.io/apex-secure-vault-official-documentation./auto-save-management.md).

# Auto-Save Management

Manually tracking when to save game data can be tedious and prone to errors, especially on mobile devices where players frequently minimize the app. Apex Secure Vault includes a robust, drop-in ApexAutoSaveManager to handle all this for you automatically.

#### Step 5.1: Setting up the Auto-Save Manager

1\.       Create an empty GameObject in your very first initial scene (e.g., Main Menu).

2\.     Name it ApexAutoSaveManager.

3\.     Attach the ApexAutoSaveManager component to it.

4\.     The manager uses DontDestroyOnLoad, meaning it will persist across all your scenes seamlessly.

#### Step 5.2: Configuring the Auto-Save Settings

Once attached, you will see several powerful toggles in the Inspector:

·         Load Settings:

o    Load On Start: Automatically loads and decrypts the vault data the moment the game launches.

·         Save Settings:

o    Save On Quit: Automatically saves data when the application is gracefully closed (Ideal for PC/Desktop).

o    Save On Pause: Automatically saves when the app is minimized or pushed to the background (Crucial for Android & iOS).

·         Periodic Save (Optional):

o    Enable Periodic Save: Enables a background coroutine that saves the game at regular intervals.

o    Save Interval Seconds: Time (in seconds) between automatic background saves (e.g., 60 seconds).

<figure><img src="/files/PypOahpZRu4YjQAwtBuQ" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://apex-studio.gitbook.io/apex-secure-vault-official-documentation./auto-save-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
