Documentation

Unity Engine

Download Unity

Unity Engine

IconAttribute

Attribute to specify an icon for a MonoBehaviour, a ScriptableObject, or a struct that implements IComponentData.
Read time 3 minutesLast updated 7 days ago

Definition

[Conditional("UNITY_EDITOR")][AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, Inherited = true, AllowMultiple = false)]public class IconAttribute : Attribute

Remarks

Unity ignores this attribute on a MonoBehaviour or an IComponentData struct in the global namespace. To use a custom icon for these types, declare the type in a namespace.

Constructors

Constructor

Description

IconAttribute(System.String)Create an IconAttribute with a path to an icon.

Properties

Property

Description

pathA project-relative path to a texture.

Inheritance

Inherited Members