# GetSpriteTexture(Sprite, bool)

> Returns the generated Sprite texture. If Sprite is packed, it is possible to query for both source and atlas textures.

## Definition

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

```csharp
public static Texture2D GetSpriteTexture(Sprite sprite, bool getAtlasData)
```

### Parameters

**** (\[Sprite]\(/engine/6000.7/script-reference/unityengine/sprite)): **** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If [Sprite](/engine/6000.7/script-reference/unityengine/sprite.md) is packed, it is possible to access data as if it was on the atlas texture.

### Returns

| Type                                                                  | Description |
| --------------------------------------------------------------------- | ----------- |
| [Texture2D](/engine/6000.7/script-reference/unityengine/texture2d.md) |             |

### Remarks

Note that the sprite atlas cache must be up to date for this API to return valid data.
