🔷Tooltip Information

Tooltips use base tooltip information class, which you can extend on your own to fully customise and simplify the interface of your project.

  • Base type: ATooltipInformation

  • Describes what the tooltip shows.

  • Examples:

    • TextTooltipInformation: single string

    • FlexibleTooltipInformation: key-value fields (text, images, etc.)

  • You can create custom info types for abilities, stats, etc.

  • You can even add reference types to the information as they are serialized in Editor!

Custom Information Example

You can define your own information data set and use it on your UI layer, populate it in editor or at runtime.

public class CustomInformation : ATooltipInformation
{
    public string title;
    public string unitInformation;
    public string unitHealth;
    
    public override bool Equals(ATooltipInformation other)
    {
        if (other is not CustomInformation info) return false;
        
        return info.title == title && 
               info.unitInformation == unitInformation && 
               info.unitHealth == unitHealth;
    }
}

🧪 Notes

If you create a constructor on your custom information, it is recommended to and an empty constructor as well.

Without empty constructor, the Inspector will not be able to create the information type in Editor (TooltipObject) and argument exception will be thrown when attempting to do so. You will have to assign the information yourself, either in Editor or Runtime.

Last updated