Skip to main content

Class TypeSelectorDisplayAttribute

Namespace: Aspid.FastTools.Types
Assembly: Aspid.FastTools.dll

Sets how the type-selector window shows a type, or hides the type with TypeSelectorDisplayAttribute.Hidden.

[Conditional("UNITY_EDITOR")]
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Interface, Inherited = false)]
public sealed class TypeSelectorDisplayAttribute : Attribute

Inheritance​

object ← Attribute ← TypeSelectorDisplayAttribute

Extension Methods​

ProfilerMarkerExtensionsForGenerator.Marker<TypeSelectorDisplayAttribute>(TypeSelectorDisplayAttribute, int)

Examples​

[TypeSelectorDisplay(
Name = "Damage ×",
Group = "Combat/Modifiers",
Tooltip = "Scales incoming damage",
Icon = "d_ScriptableObject Icon")]
public sealed class DamageModifier { }
[TypeSelectorDisplay(Hidden = true)]
public sealed class DelegateModifier : IModifier { }

Remarks​

Has no effect on a type compiled outside Unity, such as a dotnet build DLL: [Conditional("UNITY_EDITOR")] drops the usage there.

Properties​

Group​

Gets or sets the picker path that replaces the namespace, with / separating levels ("Combat/Melee"); null or whitespace keeps the namespace.

public string? Group { get; set; }

Property Value​

string?

Hidden​

Gets or sets a value indicating whether the picker hides this type.

public bool Hidden { get; set; }

Property Value​

bool

Remarks​

Not inherited by subclasses. Assigning from code and values already stored are unaffected.

Icon​

Gets or sets the icon shown left of the label: an EditorGUIUtility.IconContent name ("d_ScriptableObject Icon"), an asset path with extension ("Assets/Art/Icons/Damage.png") or a Resources path without one ("Icons/Damage"); null for none.

public string? Icon { get; set; }

Property Value​

string?

Name​

Gets or sets the name shown instead of the type's short name; null or whitespace keeps the short name.

public string? Name { get; set; }

Property Value​

string?

Remarks​

Search still matches the real name, and a generic type keeps its arguments appended (Mod<Single>).

Tooltip​

Gets or sets the tooltip shown on the type's row; null means no override.

public string? Tooltip { get; set; }

Property Value​

string?