# ToastManager

*Toast Manager allows to send Notifications during the game for better feedback and UI Response.*

* If you are using `Inventory Pro Add-On`: `ToastManager` can be located on the [`InventoryProManager` ](#user-content-fn-1)[^1]object.

<figure><img src="https://2305086192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNTLRi1iZ5Q5ZZ3QJ1Q70%2Fuploads%2FzOuHMRtwjt6WZqbaMRs8%2Fimage.png?alt=media&#x26;token=d09ceca6-9a80-421d-bb50-e7a8f396399d" alt=""><figcaption></figcaption></figure>

* If you are not using `Inventory Pro Add-On` & you want to use the `ToastManager`, you can create a new Canvas and assign the `ToastManager` component to it. If you already have a Canvas, you can simply attach `ToastManager` component to it.

<figure><img src="https://2305086192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNTLRi1iZ5Q5ZZ3QJ1Q70%2Fuploads%2FultmW1hO7GhstbixWnsl%2Fimage.png?alt=media&#x26;token=bc74cf21-1187-44bd-93bc-3075718c9331" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2305086192-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNTLRi1iZ5Q5ZZ3QJ1Q70%2Fuploads%2FmkFFGH5I54bM2PXRuRGU%2Fimage.png?alt=media&#x26;token=5f4d5184-31e4-41ce-b31f-7174bc315216" alt="" width="375"><figcaption></figcaption></figure>

### MAIN SETTINGS

* <mark style="color:purple;">toastPrefab</mark>: Reference to Toast Prefab ( UI to Spawn when a Toast Message is shown )
* <mark style="color:purple;">toastPosition</mark>: Vector2 that defines the coordinates of the Toast Prefab in the UI

### TOAST CONFIGURATION

{% hint style="info" %}
showToastOnTrade is only available for Inventory Pro.
{% endhint %}

* <mark style="color:purple;">showToastOnTrade</mark>: If true, it will display toast messages on trading (Crafting or Purchasing)

{% hint style="info" %}
showAmountTraded is only available for Inventory Pro.
{% endhint %}

* <mark style="color:purple;">showAmountTraded</mark>: If true, Toast Messages will display the amount traded (ex: Collected x3 Gears)

{% hint style="info" %}
&#x20;showToastOnInsufficientSpace is only available for Inventory Pro.
{% endhint %}

* <mark style="color:purple;">showToastOnInsufficientSpace</mark>: If true, Toast Messages will be displayed if the Inventory Space is not enough for an item to be picked up.

### MESSAGES CUSTOMIZATION

Here you can customize Notification Messages for different Actions.

### Functions | ToastManager.cs

> <mark style="color:green;">ShowToast(string message)</mark>
>
> Shows Toast Notification with Default Duration ( 2 seconds )
>
> * <mark style="color:purple;">message</mark>: Text to display on the Toast Notification.

> <mark style="color:green;">ShowToast(string message, float duration)</mark>
>
> Shows Toast Notification
>
> * <mark style="color:purple;">message</mark>: Text to display on the Toast Notification.
> * <mark style="color:purple;">duration</mark>: Time In Seconds for the Toast Message to disappear.

[^1]:
