コード例 #1
0
        /// <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;
        }
コード例 #2
0
 /// <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);
     }
 }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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;
            }
        }
コード例 #5
0
        /// <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);
            }
        }
コード例 #6
0
        /// <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 );
            }
        }
コード例 #7
0
        /// <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 + "'");
            }
        }
コード例 #8
0
 /// <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());
 }