Progression Tree Builder

v1.2.0

UI Widgets

Optional UI components for enhanced progression feedback and visibility.

Introduction

Progression Tree Builder includes optional UI widgets that provide real-time feedback to players. These components are completely optional but highly recommended for better user experience.

✨ Zero Configuration Required

Widgets auto-initialize and work immediately. No code required!

Zero Setup: All widgets automatically find and connect to ProgressionTreeManager on Start().

Available Widgets

Progression Notification System

Toast-style notifications for progression events. Shows skill unlocks, upgrades, and point awards with automatic queueing and fade animations.

Features

  • Automatic event subscription to ProgressionTreeManager
  • Queue system for multiple simultaneous events
  • Smooth fade in/out animations
  • Customizable icons per notification type

Inspector Settings

displayDurationHow long each notification stays visible (default: 3s)
fadeInDurationFade in animation duration (default: 0.3s)
fadeOutDurationFade out animation duration (default: 0.3s)
maxQueueSizeMaximum notifications in queue (default: 10)

Skill Points HUD Widget

Displays available skill points with optional click-to-open functionality. Supports both ProgressionTree and ProgressionTreeGraphAsset references.

Features

  • Real-time point tracking with pulse effect on point gain
  • Auto-selects first unlocked tree if no tree assigned
  • Click to open Progression Tree UI (optional)
  • Accepts both ProgressionTree and GraphAsset references

Inspector Settings

trackedTreeRefTree to track (ProgressionTree or GraphAsset). Leave empty to auto-select first unlocked tree.
clickToOpenTreeEnable clicking widget to open tree UI (default: true)
pulseOnPointsGainedPlay pulse animation when points are awarded (default: true)
pointsFormatString format for display (default: "{0}")

Skill Unlock Animation Overlay

Fullscreen celebration overlay when skills are unlocked. Only displays when Tree UI is closed to avoid visual conflicts.

Features

  • Auto-detects when Tree UI is open (prevents overlap)
  • Smooth fade animations without flash (CanvasGroup-based)
  • Shows skill icon, name, description, and rank
  • Configurable auto-dismiss or require input

Inspector Settings

overlayPanelMain overlay container GameObject
autoDismissAuto-close after duration (default: true)
displayDurationHow long overlay stays visible (default: 3s)
fadeInDurationFade in animation duration (default: 0.5s)
fadeOutDurationFade out animation duration (default: 0.3s)
showOnUpgradeShow for upgrades, not just first unlock (default: false)

Creating Prefabs

Use the built-in menu to create widget prefabs with proper component setup:

Unity Menu:
Tools → Progression Tree Builder → Create Widget Prefabs → All Widgets

This creates all widget prefabs in:
Assets/ProgressionTreeBuilder/Prefabs/UI/Widgets/

1. Add to Canvas

Drag the prefabs into your UI Canvas and position them as desired.

2. Initialize (Optional)

Widgets auto-initialize when ProgressionTreeManager exists. For manual control:

void Start()
{
    var manager = ProgressionTreeManager.Instance;
    
    notificationSystem.Initialize(manager);
    pointsWidget.Initialize(manager);
    unlockAnimation.Initialize(manager);
}

Custom Implementations

Create custom widgets by implementing the base interfaces:

IProgressionUIWidget Interface

Base interface implemented by all widgets. Use for custom widget development.

public interface IProgressionUIWidget
{
    void Initialize(ProgressionTreeManager manager);
    void Refresh();
    void Show();
    void Hide();
    void Cleanup();
}

ISkillUnlockAnimation Interface

Specialized interface for unlock animation components.

public interface ISkillUnlockAnimation
{
    void PlayAnimation(ProgressionSkill skill, int newRank);
    void SetAutoDismiss(bool autoDismiss);
    void Dismiss();
}

NotificationUI Fields

Individual notification item component. Attach to notification prefabs.

iconImageImage component for notification icon
messageTextTextMeshProUGUI for notification message
backgroundImageBackground image (color changes per type)
skillUnlockedIconIcon sprite for skill unlock notifications
skillUpgradedIconIcon sprite for skill upgrade notifications
pointsAwardedIconIcon sprite for points awarded notifications
treeUnlockedIconIcon sprite for tree unlock notifications

Integration

Advanced Customization

// Optional: Manually control widgets
public class MyGameUI : MonoBehaviour
{
    public SkillPointsHUDWidget pointsWidget;
    public SkillUnlockAnimationOverlay unlockAnim;
    
    void Start()
    {
        // Widgets already auto-initialized, but you can:
        
        // Change tracked tree
        pointsWidget.SetTrackedTree(differentTree);
        
        // Configure animation
        unlockAnim.SetAutoDismiss(false); // Require key press
        
        // Manual control
        pointsWidget.Show();
        pointsWidget.Hide();
    }
}

Event Hook Example

For advanced use cases, you can subscribe to Manager events directly:

public class CustomProgressionFeedback : MonoBehaviour
{
    void Start()
    {
        var manager = ProgressionTreeManager.Instance;
        
        // Listen to same events as widgets
        manager.OnSkillUnlocked += (skill, tree) => {
            PlayCustomSound();
            ShowCustomEffect();
        };
        
        manager.OnPointsAwarded += (tree, amount) => {
            UpdateCustomUI(amount);
        };
    }
}

Troubleshooting

Widget not responding to events

Checklist:

  • ProgressionTreeManager is in scene and active
  • Widget GameObject and Component are both active
  • Check Console for initialization logs (enable debugMode in widget)
  • Use Context Menu → "Debug: Print Widget Status" to verify setup
Points HUD not updating when points awarded

Common causes:

  • Tree Mismatch: Widget tracking different tree than the one receiving points
  • Instructions bypassing Manager: Use InstructionAwardSkillPoints which calls Manager.AwardPoints()
  • Not initialized: Widget shows "-" until Manager.Instance is available

Solution:

Ensure tree references match and points are awarded via Manager.AwardPoints() not direct RuntimeData access.

Unlock animation not appearing

Common causes:

  • Tree UI is open (50%): Animation blocked by design when Tree UI visible
  • Overlay Panel not assigned (30%): Inspector field empty
  • GameObject disabled (10%): Component or GameObject inactive

Debug steps:

  1. Enable debugMode in Inspector
  2. Unlock skill and check Console for event logs
  3. Use Context Menu → "Test Animation" to verify setup
Animation flashing on first show

Solution:

Fixed in v1.1.0: SkillUnlockAnimationOverlay now uses CanvasGroup for flash-free fade animations.

Fix:

  1. Re-create prefab via Widget Creator
  2. Verify OverlayPanel has CanvasGroup component with alpha=0
  3. Check backgroundDim GameObject starts inactive
"Prefab has missing script" warning on NotificationItem

Cause: Old prefab created before NotificationUI was moved to separate file.

Fix:

  1. Delete old NotificationItem.prefab and ProgressionNotificationSystem.prefab
  2. Ensure NotificationUI.cs exists in Runtime/UI/Widgets/
  3. Re-create prefabs via Menu → Create Widget Prefabs → Notification System