# DrawOverlay(string, IconOverlayType, Rect)

> Draws icon overlay.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.VersionControl](/engine/6000.5/script-reference/unityeditor/versioncontrol.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
void DrawOverlay(string assetPath, IconOverlayType type, Rect rect)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Asset path.**** (\[IconOverlayType]\(/engine/6000.5/script-reference/unityeditor/versioncontrol/iconoverlaytype)): Icon overlay type.**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Icon bounding box.

### Remarks

Unity calls this method after drawing an asset icon.

```csharp
using UnityEditor.VersionControl;
using UnityEngine;

[VersionControl("Custom")]
public class CustomVersionControlObject : VersionControlObject, IIconOverlayExtension
{
    static Texture2D s_Icon;

    static Texture2D GetIcon()
    {
        if (s_Icon == null)
        {
            s_Icon = new Texture2D(8, 8);
            for (var y = 0; y < s_Icon.height; ++y)
            {
                for (var x = 0; x < s_Icon.width; ++x)
                {
                    var border = y == 0 || y == s_Icon.height - 1 || x == 0 || x == s_Icon.width - 1;
                    var color = border ? Color.white : Color.red;
                    s_Icon.SetPixel(x, y, color);
                }
            }
            s_Icon.Apply();
        }
        return s_Icon;
    }

    public void DrawOverlay(string assetPath, IconOverlayType type, Rect rect)
    {
        var topLeft = new Rect(rect.x, rect.y, 8, 8);
        var icon = GetIcon();
        GUI.DrawTexture(topLeft, icon);
    }
}
```

Additional Resources: [IIconOverlayExtension](/engine/6000.5/script-reference/unityeditor/versioncontrol/iiconoverlayextension.md), [VersionControlObject](/engine/6000.5/script-reference/unityeditor/versioncontrol/versioncontrolobject.md), [IconOverlayType](/engine/6000.5/script-reference/unityeditor/versioncontrol/iconoverlaytype.md).
