# Methods for Editing

## **SceneReferences.cs**

For advanced use, call tooltips manually in the desired context and work with other system data. Below is a list of available methods. In your script, assign sceneReferences to access and use them. Example:

```csharp
public SceneReferences sceneRefs; // And collection containing "arrow_navigator" tooltip

void YourMethod()
{
    GameObject target;
    sceneRefs.SetTooltipTarget("arrow_navigator", target);
    sceneRefs.ShowTooltip("arrow_navigator");
}
```

### **Simple Methods For Manual Call**

<table><thead><tr><th width="185.800048828125">Public method</th><th>Example of usage</th><th>Description</th></tr></thead><tbody><tr><td>SetTooltipTarget(string tooltipName, GameObject targetObject)</td><td>sceneReferences.SetTooltipTarget("hover_enemy", targetObject);</td><td>Sets the target object that the tooltip pointer will point to</td></tr><tr><td>ShowTooltip(string tooltipName)</td><td>sceneReferences.ShowTooltip("hover_enemy");</td><td>Shows the tooltip (if allowed by Tooltip Replay setting)</td></tr><tr><td>CompleteTooltip(string tooltipName)</td><td>sceneReferences.CompleteTooltip("hover_enemy");</td><td>Hides the tooltip, marking the action as completed</td></tr><tr><td>HideDisplayingTooltips()</td><td>sceneReferences.HideDisplayingTooltips();</td><td>Hides all active tooltips, for example, if the player clicked Esc</td></tr><tr><td>TranslateAllTutorialByString(string language)</td><td>sceneReferences.TranslateAllTutorialByString("Spanish");</td><td>Translates all text tooltips by looking up their translation in the selected language column of the CSV Table (the selection is saved between sessions)</td></tr></tbody></table>

## **UIPointerAnimation.cs & WorldPointerAnimation.cs**

For advanced usage, configure the tooltip’s design depending on the target. Method below is called automatically during tooltip initialization; the developer can extend the logic to display additional elements and texts inside the prefab.

### **Simple Method For Editing**

```
#region MethodForEditing
 // Add references to custom visual elements (e.g. extra text)
 [SerializeField] private GameObject extraVisual; // Example for extra visuals
 [SerializeField] private TMP_Text extraText; // Example for extra text
 [SerializeField] private Image extraImage; // Example for extra image

 public void RedesignConsideringTarget()
 {
     GameObject targetObject = GetCurrentTarget();
     if (targetObject) // Add extra conditions here, for example, does the CharController target component have HP > 1?
     {
         // Add extra visuals, change extra texts, colors, etc.
         // Example: activate additional visual element like icon or highlight
         if (extraVisual) { extraVisual.SetActive(true); }

         // Example: set text of additional text element using localization key from tooltip data
         if (extraText)
         {
             string connectedTableKey = "key";
             sceneReferences.localizableTxts.FillTextObjectByKey(connectedTableKey, extraText);
         }
         // Example: change color of additional image element like border
         if (extraImage) { extraImage.color = Color.white; }
     }
 }
 #endregion
```

## **TooltipTrigger.cs**

### **Simple Method For Editing**

A trigger object, besides calling visuals from the collection, can handle its own highlighting logic. For example, assign an outline and show or hide it when the object is hovered over or not.

```
#region MethodForEditing
// An example of an additional visual that can be controlled by the trigger object itself
[SerializeField] private Outline outlineComponent;

public void Update()
{
    bool activeState = isRaycasted || isClicked || isCenter;
    if (outlineComponent) { outlineComponent.enabled = activeState; }
}
#endregion
```
