/// <summary> /// Override to add additional behaviour when the tooltip is shown /// </summary> /// <param name="settings">The tooltip settings</param> protected virtual void OnShowTooltip( TooltipSettings settings ) { textComponent.text = settings.message; if ( _layoutElement != null ) _layoutElement.preferredWidth = settings.preferredWidth; }
/// <summary> /// Shows a tooltip with the specified settings /// </summary> /// <param name="settings">The settings for the tooltip</param> /// <param name="tooltip">The instance of the tooltip to use</param> private void ShowTooltip(TooltipSettings settings, UITooltip tooltip) { if (tooltip != null) { HideTooltip(); _activeTooltip = tooltip; _activeTooltip.ShowTooltip(settings); } }
/// <summary> /// Shows the tooltip with the specified message /// </summary> /// <param name="message">he message to display in the tooltip</param> public void ShowTooltip(string message) { TooltipSettings settings = new TooltipSettings() { message = message, }; ShowTooltip(settings); }
/// <summary> /// Override to add additional behaviour when the tooltip is shown /// </summary> /// <param name="settings">The tooltip settings</param> protected virtual void OnShowTooltip(TooltipSettings settings) { textComponent.text = settings.message; if (_layoutElement != null) { _layoutElement.preferredWidth = settings.preferredWidth; } }
/// <summary> /// Show the tooltip with the specified settings /// </summary> /// <param name="settings">The tooltip settings</param> public void ShowTooltip(TooltipSettings settings) { if (settings != null) { gameObject.SetActive(true); OnShowTooltip(settings); } }
/// <summary> /// Show the tooltip with the specified settings /// </summary> /// <param name="settings">The tooltip settings</param> public void ShowTooltip( TooltipSettings settings ) { if ( settings != null ) { gameObject.SetActive( true ); OnShowTooltip( settings ); } }
/// <summary> /// Shows a tooltip with the specified settings /// </summary> /// <param name="settings">The settings for the tooltip</param> /// <param name="tooltipName">The name of the tooltip prefab to use</param> public void ShowModalWindow(TooltipSettings settings, string tooltipName) { UITooltip t = _tooltips.FirstOrDefault(x => x.name == tooltipName); if (t != null) { ShowTooltip(settings, t); } else { Debug.LogWarning("Cannot find tooltip with name '" + tooltipName + "'"); } }
/// <summary> /// Shows a tooltip with the specified settings /// </summary> /// <param name="settings">The settings for the tooltip</param> public void ShowTooltip(TooltipSettings settings) { ShowTooltip(settings, _tooltips.FirstOrDefault()); }