Class TooltipContent
Represents an extended tooltip for a MenuAction.
Implements
Inherited Members
Namespace: UnityEditor.ProBuilder
Assembly: Unity.ProBuilder.Editor.dll
Syntax
[Serializable]
public sealed class TooltipContent : IEquatable<TooltipContent>
Constructors
TooltipContent(string, string, params char[])
Creates a new tooltip with a title, a summary, and an optional array of characters for the shortcut.
To specify modifier keys, use the Windows control keys. ProBuilder manages switching to Linux control keys for the macOS and Linux versions of the Unity Editor.
Declaration
public TooltipContent(string title, string summary, params char[] shortcut)
Parameters
Type | Name | Description |
---|---|---|
string | title | The header text for this tooltip. |
string | summary | The body of the tooltip text. This should be kept brief. |
char[] | shortcut | A set of keys to be displayed as the shortcut for this action. |
TooltipContent(string, string, string)
Creates a new tooltip with a title, a summary, and an optional string for the shortcut.
Declaration
public TooltipContent(string title, string summary, string shortcut = "")
Parameters
Type | Name | Description |
---|---|---|
string | title | The header text for this tooltip. |
string | summary | The body of the tooltip text. This should be kept brief. |
string | shortcut | A set of keys to be displayed as the shortcut for this action. |
Properties
shortcut
Gets or sets a text representation of the (optional) shortcut assigned to this menu item.
Declaration
public string shortcut { get; set; }
Property Value
Type | Description |
---|---|
string |
summary
Gets or sets a brief summary of what this menu action does.
Declaration
public string summary { get; set; }
Property Value
Type | Description |
---|---|
string |
title
Gets or sets the title in the tooltip window.
Declaration
public string title { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
Equals(object)
Compares the title property of each tooltip to determine whether the specified tooltip is equal to this one.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare. |
Returns
Type | Description |
---|---|
bool | True if the title is the same; false otherwise. |
Overrides
Equals(TooltipContent)
Compares the title property of each tooltip to determine whether the specified tooltip is equal to this one.
Declaration
public bool Equals(TooltipContent other)
Parameters
Type | Name | Description |
---|---|---|
TooltipContent | other | The ToolTip to compare. |
Returns
Type | Description |
---|---|
bool | True if the title is the same; false otherwise. |
FromString(string)
Creates a new Tooltip with only the specified title.
Declaration
public static TooltipContent FromString(string title)
Parameters
Type | Name | Description |
---|---|---|
string | title | The title for the new Tooltip. |
Returns
Type | Description |
---|---|
TooltipContent | A new Tooltip with title and no content. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | An integer that is the hash code for this instance. |
Overrides
ToString()
Converts a Tooltip to a string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | The title of the Tooltip. |
Overrides
Operators
explicit operator TooltipContent(string)
Creates a new Tooltip with only the specified title.
Declaration
public static explicit operator TooltipContent(string title)
Parameters
Type | Name | Description |
---|---|---|
string | title | The title for the new Tooltip. |
Returns
Type | Description |
---|---|
TooltipContent | A new Tooltip with title and no content. |
explicit operator string(TooltipContent)
Converts 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 |
---|---|
string | The title of content. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | content is null. |