Tooltip System
  • WELCOME
    • πŸ‘‹Hello
  • πŸ—ΊοΈRoadmap
  • ⛑️Support & Community
  • πŸŽ“Changelog
  • GETTING STARTED
    • πŸ”ŒImport package
    • πŸ““Scene Setup
    • πŸ“šCreating Tooltip UI
    • πŸ“˜Add tooltip content
  • HOW IT WORKS
    • 🧠Tooltip System
    • πŸ”·Tooltip Information
    • πŸ”·Tooltip Display Triggers
    • πŸ”·Tooltip Visuals (UI Prefabs)
    • πŸ”ΆTooltip Positioning
    • πŸ”ΆTooltip Timing and Visibility
    • ♦️Tooltip Animation Controller
    • ♦️Tooltip Layout System
    • 🧩Extensions
Powered by GitBook
On this page
  1. HOW IT WORKS

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.

PreviousTooltip SystemNextTooltip Display Triggers

Last updated 4 days ago

πŸ”·