---
description: You can find all the information about Building Saver here.
---

# Building Saver

Save and load the position, rotation, and scale of all [Building Parts](../building-part) in a scene.

{% hint style="warning" %}
Saving may take longer depending of platforms and the number of [Building Parts](../building-part) to save.
{% endhint %}

The save path is automatically defined by the name of the scene and the platform target.

* **Standalone** Save path relative to [Application.persistentDataPath](https://docs.unity3d.com/ScriptReference/Application-persistentDataPath.html).
* **Mobiles** Save path relative to [PlayerPrefs](https://docs.unity3d.com/ScriptReference/PlayerPrefs.html).

{% hint style="info" %}
Explore fields description in the Inspector by hovering your cursor over them.\
You can find more information about this here: [Tooltip Attribute](https://docs.unity3d.com/ScriptReference/TooltipAttribute.html).
{% endhint %}

***

## API

You can access this class by including the following namespace:

```csharp
using EasyBuildSystem.Features.Runtime.Buildings.Manager.Saver;
```

This class inherits from **Singleton** class and can be called like this:

```csharp
BuildingSaver.Instance
```

Here is a list of all the events and methods of this component that can be called:

{% tabs %}
{% tab title="Events" %}
#### Events

```csharp
//Called when the save starts.
BuildingSaver.Instance.OnStartSaveEvent.AddListener(() => { });

//Called when the save ends.
BuildingSaver.Instance.OnEndingSaveEvent.AddListener(() => { });

//Called when loading starts.
BuildingSaver.Instance.OnStartLoadingEvent.AddListener(() => { });

//Called when loading ends.
BuildingSaver.Instance.OnEndingLoadingEvent.AddListener(() => { });
```
{% endtab %}

{% tab title="Methods" %}
#### Methods

```csharp
//Force save.
BuildingSaver.Instance.ForceSave();

//Force load.
BuildingSaver.Instance.ForceLoad();
```
{% endtab %}
{% endtabs %}

All of the methods related to this component can be found in the file "BuildingSaver.cs".\
If you have any specific questions about the API, feel free to contact us.
