forked from Shardstone/trail-into-darkness
38 lines
1.4 KiB
Markdown
38 lines
1.4 KiB
Markdown
# Popup System Samples
|
|
|
|
## Contents
|
|
|
|
### Prefabs
|
|
|
|
Reference prefabs for the popup system. Copy these into your project as a starting point.
|
|
|
|
| Prefab | Description |
|
|
|---|---|
|
|
| `PopupReferencePrefab` | Main popup container with Canvas, CanvasGroup, Background, and Content |
|
|
| `PopupHeader` | Header text element (TMP_Text, bold, larger font) |
|
|
| `PopupText` | Body text element (TMP_Text, regular) |
|
|
| `PopupStat` | Stat row element (HorizontalLayoutGroup with label + value TMP_Text) |
|
|
| `PopupIcon` | Image element for icons or artwork |
|
|
| `PopupSeparator` | Horizontal divider line (Image, thin) |
|
|
|
|
### Settings
|
|
|
|
| Asset | Description |
|
|
|---|---|
|
|
| `PopupSettings` | Pre-configured PopupSettings ScriptableObject with sensible defaults |
|
|
|
|
### Scripts
|
|
|
|
| Script | Description |
|
|
|---|---|
|
|
| `PopupSystemExample` | Basic setup with auto-scanned triggers, GetTrigger by name, and GetTriggers by category |
|
|
| `DynamicTriggersExample` | Setting up triggers on dynamically instantiated UI using InitializeTriggersInChildren |
|
|
| `CodeOnlyPopupExample` | Showing popups from code without PopupTrigger (anchored, fixed position, follow mouse) |
|
|
|
|
## How to use
|
|
|
|
1. Import the samples via the Unity Package Manager (select the package, expand Samples, click Import)
|
|
2. Copy the prefabs into your project's Prefabs folder
|
|
3. Create a PopupSettings asset or use the provided one
|
|
4. Reference the example scripts for integration patterns
|