🔷Tooltip Visuals (UI Prefabs)

Tooltips are rendered using your custom UI prefabs. These are:

  • Based on the ATooltipUI components

  • Shown, hidden and potentially instantiated automatically by the TooltipManager

  • Matched to the type of tooltip data (e.g., text, flexible key-value or custom info)

You can define as many styles as you want and assign them via the TooltipManager.

Out of the box, you'll find:

  • TextTooltipUI – for basic one-line descriptions

  • FlexibleTooltipUI – for dynamic lists of text and/or images (great for stats, resources, etc.)

Custom UI Example

Create custom Tooltip UI component which will supported the new information type.

public class CustomInformationUI : ATooltipUI
{
    private CustomInformation currentInfo;
    
    public override void SetInformation(ATooltipInformation info)
    {
        currentInfo = info as CustomInformation;
        
        // Update your UI elements here...
    }

    public override bool IsInformationSupported(ATooltipInformation info)
    {
        // Validate if information is supported on this UI.
        // For example Flexible tooltip uses identifier for matching in addition info type.
        return info is CustomInformation;
    }
}

Last updated