Пример #1
0
 /// <summary>
 /// Sets the lines template.
 /// </summary>
 /// <param name="lines">Lines template.</param>
 public static void SetLines(UITooltipLines lines)
 {
     if (mInstance != null)
     {
         mInstance.Internal_SetLines(lines);
     }
 }
Пример #2
0
        /// <summary>
        /// Adds spacer line.
        /// </summary>
        protected virtual void Internal_AddSpacer()
        {
            // Make sure we have a template initialized
            if (this.m_LinesTemplate == null)
            {
                this.m_LinesTemplate = new UITooltipLines();
            }

            this.m_LinesTemplate.AddLine("", new RectOffset(0, 0, UITooltipManager.Instance.spacerHeight, 0));
        }
Пример #3
0
        /// <summary>
        /// Adds title line.
        /// </summary>
        /// <param name="title">Tooltip title.</param>
        protected virtual void Internal_AddTitle(string title)
        {
            // Make sure we have a template initialized
            if (this.m_LinesTemplate == null)
            {
                this.m_LinesTemplate = new UITooltipLines();
            }

            // Add the title line
            this.m_LinesTemplate.AddLine(title, new RectOffset(0, 0, 0, 0), UITooltipLines.LineStyle.Title);
        }
Пример #4
0
        /// <summary>
        /// Adds description line.
        /// </summary>
        /// <param name="description">Tooltip description.</param>
        protected virtual void Internal_AddDescription(string description)
        {
            // Make sure we have a template initialized
            if (this.m_LinesTemplate == null)
            {
                this.m_LinesTemplate = new UITooltipLines();
            }

            // Add the description line
            this.m_LinesTemplate.AddLine(description, new RectOffset(0, 0, 0, 0), UITooltipLines.LineStyle.Description);
        }
Пример #5
0
        /// <summary>
        /// Adds a column (Either to the last line if it's not complete or to a new one).
        /// </summary>
        /// <param name="a">Content.</param>
        /// <param name="style">The custom line style name.</param>
        protected void Internal_AddLineColumn(string a, string customStyle)
        {
            // Make sure we have a template initialized
            if (this.m_LinesTemplate == null)
            {
                this.m_LinesTemplate = new UITooltipLines();
            }

            // Add the column
            this.m_LinesTemplate.AddColumn(a, customStyle);
        }
Пример #6
0
        /// <summary>
        /// Adds a new single column line.
        /// </summary>
        /// <param name="a">Content.</param>
        /// <param name="padding">The line padding.</param>
        /// <param name="customStyle">The custom line style name.</param>
        protected void Internal_AddLine(string a, RectOffset padding, string customStyle)
        {
            // Make sure we have a template initialized
            if (this.m_LinesTemplate == null)
            {
                this.m_LinesTemplate = new UITooltipLines();
            }

            // Add the line
            this.m_LinesTemplate.AddLine(a, padding, customStyle);
        }
Пример #7
0
        /// <summary>
        /// Adds a new single column line.
        /// </summary>
        /// <param name="a">Content.</param>
        /// <param name="style">The line style.</param>
        protected void Internal_AddLine(string a, UITooltipLines.LineStyle style)
        {
            // Make sure we have a template initialized
            if (this.m_LinesTemplate == null)
            {
                this.m_LinesTemplate = new UITooltipLines();
            }

            // Add the line
            this.m_LinesTemplate.AddLine(a, new RectOffset(), style);
        }
Пример #8
0
        /// <summary>
        /// Does a line cleanup.
        /// </summary>
        protected virtual void CleanupLines()
        {
            // Clear out the line objects
            foreach (Transform t in this.transform)
            {
                // If the component is not part of the layout dont destroy it
                if (t.gameObject.GetComponent <LayoutElement>() != null)
                {
                    if (t.gameObject.GetComponent <LayoutElement>().ignoreLayout)
                    {
                        continue;
                    }
                }

                Destroy(t.gameObject);
            }

            // Clear out the attributes template
            this.m_LinesTemplate = null;
        }
Пример #9
0
 /// <summary>
 /// Sets the lines template.
 /// </summary>
 /// <param name="lines">Lines template.</param>
 protected void Internal_SetLines(UITooltipLines lines)
 {
     this.m_LinesTemplate = lines;
 }