> For the complete documentation index, see [llms.txt](https://assetstore.easysave.voxelbusters.com/tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://assetstore.easysave.voxelbusters.com/tutorials/save-data-serialize.md).

# Save Data (Serialize)

For using this plugin methods you need to import the required namespace. Please include the below statement at namespace include list

```
using VoxelBusters.Serialization;
```

We provide a generic method to save(Serialize) any kind of data. For serializing data you need to specify a key. This key is used to retrieve the data back again during deserialization.

{% hint style="info" %}
**Performance Tip** : For Int, Float and String we provide direct methods to serialize and deserialize to get best performance when compared to generic method call. So, if possible try to use direct call if applicable.
{% endhint %}

### Examples

#### Save Int

{% tabs %}
{% tab title="Generic Usage" %}

```csharp
SerializationManager.Serialize<int>("myInt",123);
```

{% endtab %}

{% tab title="Direct Usage" %}

```csharp
SerializationManager.SerializeInt32("myInt",123);
```

{% endtab %}
{% endtabs %}

#### Save Float

{% tabs %}
{% tab title="Generic Usage" %}

```csharp
SerializationManager.Serialize<float>("myFloat",111.11f);
```

{% endtab %}

{% tab title="Direct Usage" %}

```
SerializationManager.SerializeSingle("myFloat",111.11f);
```

{% endtab %}
{% endtabs %}

#### Save Double

```csharp
SerializationManager.Serialize<double>("myDouble",129.0);
```

#### Save String

{% tabs %}
{% tab title="Generic Usage" %}

```csharp
SerializationManager.Serialize<string>("myString","string value");
```

{% endtab %}

{% tab title="Direct Usage" %}

```csharp
SerializationManager.SerializeString("myString","string value");
```

{% endtab %}
{% endtabs %}

#### Save GameObject

```
SerializationManager.Serialize<GameObject>("gameObject",gameObjectInstance);
```

#### Save List

```
List<GameObject> gameObjectsList = new List<GameObject>();
....
....
....
SerializationManager.Serialize<List<GameObject>>("gameObjects", gameObjectList);
```

## Video Tutorials

{% content-ref url="/pages/-LNzVxmTkn46VuKUgpZi" %}
[Basic Save](/tutorials/video-tutorials/basic-save.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LNzWAcWTuR\_CEev9\_yj" %}
[Save Scene Objects](/tutorials/video-tutorials/save-scene-objects.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LNzWRi-AA89Cb4bcrTC" %}
[Save Custom Objects](/tutorials/video-tutorials/save-custom-objects.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LNzWYJRUvPJtX33CIMy" %}
[Batch Save Calls](/tutorials/video-tutorials/batch-save-calls.md)
{% endcontent-ref %}
