Tooltip System

Guide on how to integrate tooltips with Unit System.

Overview

This page is for guiding you through the process of basic integration for Tooltip System package. Refer to the Tooltip System Guide if you need more information.

1. Setup Scene

If you do not have Tooltip System package present, then follow it's guide for import and scene setup:

  • Create empty object and add TooltipManager component or drag Tooltip Manager prefab into your scene. Check all the tabs and configure it for your project.

2. Hovering over Entities and Units

To achieve hover over units you can follow the steps on guide or:

  • Add Tooltip Object and Hover Object components to root game object of your prefabs.

  • Then add the demo script SetEntityTooltipInformation which uses regular TextTooltipInformation type of information.

  • To see the information when hovering object, you also need a UI element to show the information on. Add Tooltip UI in your scene and reference it in the manager (with TextTooltipInformation type), otherwise it will not be found when manager will be search for tooltip text options.

3. Hover over UI

To achieve hovering over UI elements, the first step and last steps are the same as before:

  • Add Tooltip Object and Hover Object components to root game object of your UI prefabs (or scene defined UI, does not need to be a prefab).

  • Then add if you are using demo prefab for UI UnitProductionView , then you need only to add

    the demo script UnitProductionViewTooltipInfo. If you have a custom one, check the code example below.

  • To see the information when hovering object, you also need a UI element to show the information on. Add Tooltip UI in your scene and reference it in the manager (with TextTooltipInformation type), otherwise it will not be found when manager will be search for tooltip text options.

Custom UI

You can use custom UI Action element for production or any other action defined by your entities and units. If you are unfamiliar with this see the IEntityUIHandler or AUnitUIHandler which is responsible for feeding it to the UI.

Last updated