# SetSpriteID(Sprite, GUID)

> Sets a Sprite 's Global Unique Identifier (GUID) for easy identification later.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.U2D](/engine/6000.7/script-reference/unityeditor/u2d.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static void SetSpriteID(this Sprite sprite, GUID guid)
```

### Parameters

**** (\[Sprite]\(/engine/6000.7/script-reference/unityengine/sprite)): The Sprite to set.**** (GUID): The GUID to set for the Sprite.

### Remarks

During Sprite Asset generation, you can manually set a [Sprite's](/engine/6000.7/script-reference/unityengine/sprite.md) SpriteID to identify the [Sprite](/engine/6000.7/script-reference/unityengine/sprite.md) from the data that was used to generate it.

This is usually needed when [Sprites](/engine/6000.7/script-reference/unityengine/sprite.md) are generated by [ScriptedImporter](/engine/6000.7/script-reference/unityeditor/assetimporters/scriptedimporter.md) via [Sprite.Create](/engine/6000.7/script-reference/unityengine/sprite/create.md) and the [ScriptedImporter](/engine/6000.7/script-reference/unityeditor/assetimporters/scriptedimporter.md) wants to support SpriteEditorModuleBase that uses [AssetPostprocessor](/engine/6000.7/script-reference/unityeditor/assetpostprocessor.md) to modify during [Sprite](/engine/6000.7/script-reference/unityengine/sprite.md) generation.
