> For the complete documentation index, see [llms.txt](https://cowsinss-organization.gitbook.io/save-and-load-add-on/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cowsinss-organization.gitbook.io/save-and-load-add-on/how-to-use-and-guides/how-to-add-buttons-to-save-and-load-a-game.md).

# How to add Buttons to Save & Load a game

{% hint style="warning" %}
Game can only be saved if DataPersistenceManager exists in the scene.
{% endhint %}

As explained in [*Save & Load Games Programmatically*](/save-and-load-add-on/how-to-use-and-guides/save-and-load-games-programmatically.md), saving and loading games requires just a single line of code. To make it even easier, you can create buttons that handle saving and loading without writing any code.

Simply add a button to your UI and assign the [**SaveLoadButton** ](/save-and-load-add-on/content/03.-content/03.9-ui/saveloadbutton.md)component to it. This component offers two methods: **SaveGame()** and **LoadGame(),** which you can link to the button’s `onClick` event.

Once set up, clicking the button will trigger the save or load function based on your needs.

{% hint style="info" %}
CowsinsButton inherits from Unity´s Button
{% endhint %}

<figure><img src="https://2305086192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNTLRi1iZ5Q5ZZ3QJ1Q70%2Fuploads%2FyElb1RiWrz8Q4SmrUyUN%2Fimage.png?alt=media&amp;token=261418d5-43d8-43e3-a30e-17a0fc399a93" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Refer to [SaveLoadButton ](/save-and-load-add-on/content/03.-content/03.9-ui/saveloadbutton.md)for more Information.
{% endhint %}
