# GetIcon(string)

> Gets the custom icon to associate with a MonoScript at import time.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public Texture2D GetIcon(string className)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The fully qualified class name of a [MonoScript](/engine/6000.0/script-reference/unityeditor/monoscript.md) imported by this plugin.

### Returns

| Type                                                                  | Description                                                                                                                                                                                                                                                                              |
| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Texture2D](/engine/6000.0/script-reference/unityengine/texture2d.md) | Returns the custom icon that will be associated with the imported [MonoScript](/engine/6000.0/script-reference/unityeditor/monoscript.md). If no custom icon will be associated with the imported [MonoScript](/engine/6000.0/script-reference/unityeditor/monoscript.md), returns null. |

### Remarks

Additional Resources: [MonoScript.GetClass](/engine/6000.0/script-reference/unityeditor/monoscript/getclass.md), FullName, [PluginImporter.SetIcon](/engine/6000.0/script-reference/unityeditor/pluginimporter/seticon.md), [EditorGUIUtility.GetIconForObject](/engine/6000.0/script-reference/unityeditor/editorguiutility/geticonforobject.md).

### Examples

```csharp
using UnityEngine;
using UnityEditor;

class Example
{
    [MenuItem("Examples/Get Icon for MonoScript from PluginImporter")]
    public static void GetIconForMonoScriptFromPluginImporter()
    {
        var assetPath = "Assets/MyManagedPlugin.dll";
        var pluginImporter = AssetImporter.GetAtPath(assetPath) as PluginImporter;
        var monoScript = AssetDatabase.LoadAssetAtPath<MonoScript>(assetPath);

        var icon = pluginImporter.GetIcon(monoScript.GetClass().FullName);
        Debug.Log("Icon for " + monoScript.GetClass().FullName + " in " + assetPath + " is " + icon);
    }
}
```
