MultiSet
Developer PortalContact UsTutorials
  • MultiSet Developer Docs
  • Getting Started
    • Changelog
    • MultiSet Unity SDK
      • Universal 3D (Core) support
    • FAQ
  • Basics
    • Maps
      • Mapping Instruction
      • Mapping Planning
      • Mapping Equipment
    • MapSet : Multiple Maps
      • Merging Maps without Overlap
        • Extend a MapSet
      • Merging Maps with Overlap
      • Adjust Map Transformation
    • ModelSet: Object Anchoring
      • How to Create a ModelSet
    • App Localization
    • Credentials
    • Analytics and Usage
    • Downloads
    • REST API Docs
    • WebXR Integration
    • Third Party Scans
      • Matterport
      • Leica Scans
    • MapFoundry
    • Georeferencing Maps
      • How to Align Scans
      • Outdoor-Indoor Transitions with Multiset
    • On-Premises Localization
    • Support
  • Unity-SDK
    • Authentication
    • Sample Scenes
      • Localization
      • Single Frame Localization
      • ModelSet Tracking
      • Navigation
      • Training
    • On-Cloud Localization
      • Individual Map
      • MapSet (Multiple maps)
        • Hint MapCodes
      • Pose Prior : HintPosition
      • GeoHint in Localization
    • Occlusion
    • NavMesh Navigation
    • Multiplayer AR
    • Building Steps
    • API Reference
      • MultisetSdkManager
      • MapLocalizationManager
      • SingleFrameLocalizationManager
      • ModelSetTrackingManager
      • MapMeshHandler
      • ToastManager
  • MultiSet-Quest-SDK
    • Installation Guide
    • Map Mesh Downloader
    • Authentication
    • Sample Scenes
      • Single Frame Localization
  • Native Support
    • iOS Native
    • Android Native
  • MultiSet App
    • Content Space
Powered by GitBook
On this page
  1. Unity-SDK
  2. API Reference

ToastManager

PreviousMapMeshHandlerNextInstallation Guide

Last updated 17 days ago

Was this helpful?

CtrlK
  • Properties
  • Methods

Was this helpful?

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.

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.

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

ShowAlert()

Displays an alert message on the screen.

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.

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