> For the complete documentation index, see [llms.txt](https://mandor-labs.gitbook.io/mandor-labs-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mandor-labs.gitbook.io/mandor-labs-docs/save-load/getting-started/quickstart.md).

# Quickstart

## Steps

{% stepper %}
{% step %}

#### Create Save Data

This example show you how to create simple `CustomPlayerData`

```csharp
[Serializable]
public class CustomPlayerData
{
    public string id;
    public int score;
    public Dictionary<string,object> attributes;
}
```

{% endstep %}

{% step %}

#### Create Save Load Handler

In this step you will create `CustomSaveLoadHandler` that inherit from `SaveLoadFileHandler<T>`&#x20;

```csharp
[Serializable]
public class CustomSaveLoadHandler : SaveLoadFileHandler<CustomPlayerData>
{
    public override float order => 0;
    public override string description => "This is sample for custom save load handler";

    protected override CustomPlayerData SaveData()
    {
        //return your custom data here
    }

    protected override void LoadData(CustomPlayerData data)
    {
        //handle load data here
    }
}
```

{% endstep %}

{% step %}

### Create Save Load Handler Asset

In this step you will create asset to store your handler.

1. Right click on project and choose `Create` :arrow\_right: `Modular Labs` :arrow\_right: `Save Load` :arrow\_right: `Handler` .
2. Select `SaveLoadHandler` class that you create previous.
3. Make sure no validation message error appear.

<div data-with-frame="true"><figure><img src="/files/uVox0MaresjDXsibx86s" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Create Save Load Config

in this step you will create save load configuration to register your previous handler asset. If you want to enable Slot feature you can enable in this config asset.

To create save load config you can right click on project window and choose `Create` :arrow\_right: `Modular Labs` :arrow\_right: `Save Load` :arrow\_right: `Config` .

<div data-with-frame="true"><figure><img src="/files/EsWJb8LscqTGoXBpdrzc" alt=""><figcaption></figcaption></figure></div>

{% hint style="danger" %}
I recommend having a different file extension for every SaveLoadHandler, so the data does not blend with other save data. For example, you have a save load handler for the player and the inventory. You can make two different file extensions. For player, you can use ‘.player’ and for inventory, you can use ‘.inv’.
{% endhint %}
{% endstep %}

{% step %}

### Register Into Database

Before you can use this system you need to setup register your `Save Load Config` into Save `Load Database Component` .

1. Create empty game object and add component `Save Load Database`&#x20;
2. Assign previous `Save Load Config Asset` into this component.

<div data-with-frame="true"><figure><img src="/files/XCDEzQ4xfDfLzDLnXpzi" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Press Play

Now you can press play on unity editor and check to `Save Load Handler Explorer` to makesure your `CustomSaveLoadhandler` is registered.

You can access this explorer from `Tools` :arrow\_right: `Modular Labs` :arrow\_right: `Save Load` :arrow\_right: `Handlers`

<div data-with-frame="true"><figure><img src="/files/oZQXOWCG1qaeMvruWauv" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}

### Save & Load

This is example for save and load using API

```csharp

var fileName = "mysave";
var saveLoadHandler = SaveLoadHandler.GetSaveLoadHandler<CustomSaveLoadHandler>();
    
//save 
saveLoadHandler.Save(fileName);

//load
saveLoadHandler.Load(fileName);

//you need turn on Slot feature in SaveLoadConfigAsset to use slot feature and API
var slot = SaveLoadFileSlot.GetSlot(slotIndex);
            
//save slot
slot.Save();

//load slot
slot.Load();
```

{% endstep %}
{% endstepper %}


---

# 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://mandor-labs.gitbook.io/mandor-labs-docs/save-load/getting-started/quickstart.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.
