# IAssetProvider

Interface in [Yarn.Unity](/3.1/api/csharp/yarn.unity.md)

## Summary

Contains methods for accessing assets of a given type stored within an object.

```csharp
public interface IAssetProvider
```

## Methods

| Name                                                                                                                   | Description                                              |
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| [GetAssetsOfType()](/3.1/api/csharp/yarn.unity/yarn.unity.iassetprovider/yarn.unity.iassetprovider.getassetsoftype.md) | Gets a collection of assets of type `T` from the target. |
| [TryGetAsset(T?)](/3.1/api/csharp/yarn.unity/yarn.unity.iassetprovider/yarn.unity.iassetprovider.trygetasset.md)       | Attempts to fetch an asset of type `T` from the object.  |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/3.1/api/csharp/yarn.unity/yarn.unity.iassetprovider.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
