Class TooltipContent
Represents an extended tooltip for a MenuAction.
Inherited Members
Namespace: UnityEditor.ProBuilder
Syntax
[Serializable]
public sealed class TooltipContent : IEquatable<TooltipContent>
Constructors
TooltipContent(String, String, 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 |
---|---|
Boolean | 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 |
---|---|
Boolean | True if the title is the same; false otherwise. |
Implements
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 |
---|---|
Int32 | 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(String to TooltipContent)
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(TooltipContent to String)
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. |