# OverlayAttribute

> Attribute used to register a class as an Overlay.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEditor.Overlays](/engine/6000.7/script-reference/unityeditor/overlays.md)
* **Assembly:** UnityEditor.CoreModule

## OverlayAttribute()

Attribute used to register a class as an [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md).

```csharp
public OverlayAttribute()
```

### Remarks

Overlays are not directly instantiated in code. The Editor will use reflection on startup to identify [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md) classes with an [OverlayAttribute](/engine/6000.7/script-reference/unityeditor/overlays/overlayattribute.md) to populate the available Overlays in an Editor Window.

## OverlayAttribute(Type, string, string, string, bool)

Attribute used to register a class as an [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md).

```csharp
public OverlayAttribute(Type editorWindowType, string id, string displayName, string ussName, bool defaultDisplay = false)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Defines which EditorWindow type the overlay will be used in.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Defines the unique identifier used to identify the overlay.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Defines what the display name of the overlay will be.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Name of the overlay's root visual element.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True if this [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md) is enabled by default in new windows.

### Remarks

Overlays are not directly instantiated in code. The Editor will use reflection on startup to identify [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md) classes with an [OverlayAttribute](/engine/6000.7/script-reference/unityeditor/overlays/overlayattribute.md) to populate the available Overlays in an Editor Window.

## OverlayAttribute(Type, string, string, bool)

Attribute used to register a class as an [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md).

```csharp
public OverlayAttribute(Type editorWindowType, string id, string displayName, bool defaultDisplay = false)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Defines which EditorWindow type the overlay will be used in.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Defines the unique identifier used to identify the overlay.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Defines what the display name of the overlay will be.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True if this [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md) is enabled by default in new windows.

### Remarks

Overlays are not directly instantiated in code. The Editor will use reflection on startup to identify [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md) classes with an [OverlayAttribute](/engine/6000.7/script-reference/unityeditor/overlays/overlayattribute.md) to populate the available Overlays in an Editor Window.

## OverlayAttribute(Type, string, bool)

Attribute used to register a class as an [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md).

```csharp
public OverlayAttribute(Type editorWindowType, string displayName, bool defaultDisplay = false)
```

### Parameters

**** (\[Type]\(https\://learn.microsoft.com/dotnet/api/system.type)): Defines which EditorWindow type the overlay will be used in.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Defines what the display name of the overlay will be.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): True if this [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md) is enabled by default in new windows.

### Remarks

Overlays are not directly instantiated in code. The Editor will use reflection on startup to identify [Overlay](/engine/6000.7/script-reference/unityeditor/overlays/overlay.md) classes with an [OverlayAttribute](/engine/6000.7/script-reference/unityeditor/overlays/overlayattribute.md) to populate the available Overlays in an Editor Window.
