Class TooltipContent
An extended tooltip for use in MenuAction.
Inheritance
Namespace: UnityEditor.ProBuilder
Syntax
[Serializable]
public sealed class TooltipContent : IEquatable<TooltipContent>
Constructors
TooltipContent(String, String, Char[])
Create a new tooltip.
Declaration
public TooltipContent(string title, string summary, params char[] shortcut)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | The header text for this tooltip. |
System.String | summary | The body of the tooltip text. This should be kept brief. |
System.Char[] | shortcut | A set of keys to be displayed as the shortcut for this action. |
TooltipContent(String, String, String)
Create a new tooltip.
Declaration
public TooltipContent(string title, string summary, string shortcut = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | title | The header text for this tooltip. |
System.String | summary | The body of the tooltip text. This should be kept brief. |
System.String | shortcut | A set of keys to be displayed as the shortcut for this action. |
Properties
shortcut
The shortcut assigned to this menu item.
Declaration
public string shortcut { get; set; }
Property Value
Type | Description |
---|---|
System.String | A text representation of the optional shortcut. |
summary
A brief summary of what this menu action does.
Declaration
public string summary { get; set; }
Property Value
Type | Description |
---|---|
System.String | The body of the summary text. |
title
The title to show in the tooltip window.
Declaration
public string title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The header text for this tooltip. |
Methods
Equals(Object)
Equality check is performed by comparing the title property of each tooltip.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The ToolTip content to compare. |
Returns
Type | Description |
---|---|
System.Boolean | True if title is the same, false otherwise. |
Overrides
Equals(TooltipContent)
Equality check is performed by comparing the title property of each tooltip.
Declaration
public bool Equals(TooltipContent other)
Parameters
Type | Name | Description |
---|---|---|
TooltipContent | other | The ToolTip content to compare. |
Returns
Type | Description |
---|---|
System.Boolean | True if title is the same, false otherwise. |
FromString(String)
Create a new tooltip with title.
Declaration
public static TooltipContent FromString(string title)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | The title to apply to the new Tooltip. |
Returns
Type | Description |
---|---|
TooltipContent | A new Tooltip with title and no content. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToString()
Convert a Tooltip to a string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | The title of the Tooltip. |
Overrides
Operators
Explicit(String to TooltipContent)
Create a Tooltip with a title.
Declaration
public static explicit operator TooltipContent(string title)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | The title to apply to the new Tooltip. |
Returns
Type | Description |
---|---|
TooltipContent | A new Tooltip with title and no content. |
Explicit(TooltipContent to String)
Convert a tooltip to a string.
Declaration
public static explicit operator string (TooltipContent content)
Parameters
Type | Name | Description |
---|---|---|
TooltipContent | content | The Tooltip to convert. |
Returns
Type | Description |
---|---|
System.String | The title of content. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | content is null. |