> For the complete documentation index, see [llms.txt](https://docs.multiset.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.multiset.ai/unity-sdk/ar-foundation/api-reference/toastmanager.md).

# ToastManager

The Unity singleton that shows short on-screen toast messages such as localization success or failure.

#### Toast Manager

The ToastManager is a singleton utility component within the MultiSet SDK responsible for displaying temporary, non-interactive messages on the screen. It is used throughout the SDK to provide users with immediate feedback, such as "Localization Success" or "Network Error".

#### **Description**

This manager controls a UI element, typically consisting of a CanvasGroup and a Text component, to create a "toast" or "alert" message. It makes the message fade in, stay visible for a short period, and then fade out automatically. As a singleton, it can be easily accessed from any other script in your project using ToastManager.Instance without needing a direct reference.

## **Properties**

This section details the publicly accessible fields of the ToastManager that you can configure in the Unity Editor.

| Property        | Type                | Description                                                                                                                                                        |
| --------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Instance        | static ToastManager | The static singleton instance of the ToastManager. This provides a global access point to the manager's functionality.                                             |
| toastText       | Text                | The Unity UI Text component where the message content will be displayed. This should be a child of the GameObject that has the CanvasGroup.                        |
| canvasGroup     | CanvasGroup         | The CanvasGroup component that controls the alpha (transparency) and raycast blocking of the entire toast UI element. This is used to fade the message in and out. |
| fadeDuration    | float               | The duration in seconds that the fade-in and fade-out animations will take. The default value is 0.5f.                                                             |
| displayDuration | float               | The duration in seconds that the toast message will remain fully visible on the screen after fading in and before it starts to fade out. The default value is 2f.  |

## **Methods**

This section describes the publicly accessible methods of the ToastManager.

**ShowToast()**

Displays a toast message on the screen.

```csharp
public void ShowToast(string message)
```

**Description**\
When you call this method, the provided message string is assigned to the toastText component, and the toast UI begins its fade-in and fade-out sequence. The entire animation is handled automatically.

```csharp
ToastManager.Instance.ShowToast("Your action was successful!");
```

**ShowAlert()**

Displays an alert message on the screen.

```csharp
public void ShowAlert(string alertText)
```

**Description**\
This method is functionally identical to ShowToast(). It takes a string alertText and displays it using the same fade-in and fade-out animation. It is provided as an alternative name for semantic clarity in your code.

```csharp
ToastManager.Instance.ShowAlert("Warning: Low battery.");
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.multiset.ai/unity-sdk/ar-foundation/api-reference/toastmanager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
