# GetCachedIcon(string)

> Retrieves the cached icon for the asset at the given path, without loading the asset. This is the icon shown in the Project window list view.

## Definition

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

```csharp
public static Texture GetCachedIcon(string path)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Path to the asset.

### Returns

| Type                                                              | Description                                                                                                                      |
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| [Texture](/engine/6000.0/script-reference/unityengine/texture.md) | A generic type icon for non-texture assets, and a small aspect-correct thumbnail for textures, or null if the asset has no icon. |

### Remarks

The icon is resolved from the Asset Database and reflects per-asset distinctions (custom MonoScript icons, open/closed folders, prefab type, importer-assigned icons). For textures it returns a small, aspect-correct thumbnail baked at import time (correct even for normal maps), not the raw texture. This is more efficient than [AssetPreview.GetAssetPreview](/engine/6000.0/script-reference/unityeditor/assetpreview/getassetpreview.md) and is always available, but it is an icon lookup rather than a live render. For non-texture assets such as materials or models it returns a generic type icon rather than a rendered preview.

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;

public class AssetDatabaseExamples : MonoBehaviour
{
    [MenuItem("AssetDatabase/Get Cached Icon Example")]
    public static void GetCachedIconExample()
    {
        var textureList = new List<Texture>();
        //Get asset icons and put them in a list
        foreach (var guid in AssetDatabase.FindAssets("", new []{"Assets"}))
        {
            var path = AssetDatabase.GUIDToAssetPath(guid);
            textureList.Add(AssetDatabase.GetCachedIcon(path));
        }

        //Set Material textures to the asset icons
        var textureNo = 0;
        for (var i = 0; i < 10; i++)
        {
            var path = $"Assets/Materials/GroundMaterial{i}.mat";
            var asset = (Material)AssetDatabase.LoadMainAssetAtPath(path);
            if (textureNo >= textureList.Count)
                textureNo = 0;
            asset.mainTexture = textureList[textureNo++];
        }
    }
}
```
