UI Setup: Toast Notifications (RaceToastBridge)
This guide explains how to enable Sirocco Race Timing toast notifications using the included UnityToast integration.
For full UnityToast documentation (setup, custom prefabs, and troubleshooting), see:
- Assets/UnityToast/Documentation/index.md
RaceTiming uses the component:
- RaceTiming.UI.RaceToastBridge
And it requires:
- UnityToast.ToastManager
What you get (when enabled)
Depending on toggles in RaceToastBridge, you can display toasts for:
- Lap completed
- Personal best lap
- Session best lap
- Personal best sector
- Session best sector
- Position changes
1) Add a ToastManager to the scene
Option A (recommended): Use the prefab
If your project includes the UnityToast prefabs, use:
- Assets/UnityToast/Prefabs/ToastManager.prefab
Drag it into your scene.
Option B: Create manually
If you don’t have a prefab, create a GameObject and add the ToastManager component (from the UnityToast package). Ensure it has/creates a Canvas as required by UnityToast.
2) Add RaceToastBridge
- Create an empty GameObject named
RaceToastBridge(name is not required, but helpful). - Add component:
RaceToastBridge
At runtime, the bridge will try to find:
- a ToastManager in the scene
- a RaceTimingManager in the scene
If either is missing, it logs a warning and disables toasts.
3) Configure which toasts to show
In the RaceToastBridge Inspector, enable the event types you care about.
Defaults (as shipped): - Lap completions: enabled - Personal best lap: enabled - Session best lap: enabled - Position changes: disabled - Personal best sectors: enabled - Session best sectors: enabled
Common presets:
“Broadcast-style”
- Enable: Session best lap, session best sector
- Disable: personal best sector (can be noisy)
“Player feedback” (single-player)
- Enable: personal best lap, personal best sector
- Enable: session best lap/sector (optional)
“Minimal”
- Enable: lap completed
- Enable: session best lap
4) Icons and colors
RaceToastBridge includes the following Inspector fields:
Colors
- Personal Best Color (default: green)
- Session Best Color (default: magenta)
Icons (Sprite)
- Lap Icon
- Personal Best Icon
- Session Best Icon
- Position Up Icon
- Position Down Icon
Notes:
- If an icon sprite is not assigned, the toast will render without an icon (the default ToastView supports a no-icon layout).
- Colors are injected into the toast message using rich text color tags (e.g., <color=#RRGGBB>...</color>), so your toast text component must have Rich Text enabled.
5) Validate
Press Play and look for:
Expected behavior
- When a lap/sector event occurs, a toast appears.
Console warnings
If you see:
- [RaceToastBridge] No ToastManager found in scene. Toast notifications will be disabled.
- Add a ToastManager.
[RaceToastBridge] No RaceTimingManager found in scene. Toast notifications will be disabled.- Add a
RaceTimingManager.
Common pitfalls
ToastManager exists but nothing displays
- Ensure ToastManager is enabled and has a Canvas/UI root
- Ensure the toast prefab/view is assigned (UnityToast-side)
- Ensure
RaceToastBridgetoggles are enabled
Too many notifications
- Disable personal best sector toasts (high frequency)
- Prefer session best-only in multi-car races
Screenshot / GIF placeholders (for later)
Recommended captures:
1. Hierarchy showing ToastManager + RaceToastBridge
2. Inspector screenshot with recommended toggles
3. Game view showing a best sector toast