Comment on page
In this tutorial, we will fetch the game sprites from the ReadyNFT Asset Hub
FetchSpritesAsyncmethod is used to asynchronously fetch sprite objects from the ReadyNFT API. This method retrieves information about the NFTs associated with your game, such as their IDs, names, contract addresses, images, and stats.
Note: Before calling the
FetchSpritesAsyncmethod, ensure that you have already initialised the ReadyNFT SDK by calling the
Initmethod. Refer to our Initialising the SDK guide for an in-depth look at the same.
public async Task<List<ReadyNFTSpriteObject>> FetchSpritesAsync()
public class ReadyNFTManager : MonoBehaviour
private const string apiKey = "your-api-key";
private const string gameId = "your-game-id";
public async void InitializeReadyNFT()
ReadyNFT readyNFT = new ReadyNFT();
List<ReadyNFTSpriteObject> sprites = await readyNFT.FetchSpritesAsync();
By utilising the
FetchSpritesAsyncmethod, you can retrieve detailed information about the NFT sprites associated with your game. This data can then be used to create visual representations of the NFTs or to implement various game mechanics based on the fetched sprite objects.