Skip to main content

Retrieving Assets

Retrieving assets from a catalogue​

csharp
async void RetrieveAssets()
{
Catalogue[] catalogues = await session.GetCatalogues();
if (catalogues == null || catalogues.Length == 0)
Debug.LogError("Couldn't get organization's catalogues");
// Most of the times, you will only have a single catalogue
Catalogue myCatalogue = catalogues[0];
// Get an list of outfits, filtered by gender and style
Paginated<Outfit> outfits = await session.GetAssets<Outfit>(
catalogue: myCatalogue.Id,
type: AssetType.outfits,
style: Style.phr,
gender: Gender.male
);
// Garments
Paginated<Garment> garments = await session.GetAssets<Garment>(
catalogue: myCatalogue.Id,
type: AssetType.garments,
style: Style.phr,
gender: Gender.male
);
// Hairs
Paginated<Hair> hairs = await session.GetAssets<Hair>(
catalogue: myCatalogue.Id,
type: AssetType.hairs,
style: Style.phr,
gender: Gender.male
);
// ...
}
csharp
async void RetrieveAssets()
{
Catalogue[] catalogues = await session.GetCatalogues();
if (catalogues == null || catalogues.Length == 0)
Debug.LogError("Couldn't get organization's catalogues");
// Most of the times, you will only have a single catalogue
Catalogue myCatalogue = catalogues[0];
// Get an list of outfits, filtered by gender and style
Paginated<Outfit> outfits = await session.GetAssets<Outfit>(
catalogue: myCatalogue.Id,
type: AssetType.outfits,
style: Style.phr,
gender: Gender.male
);
// Garments
Paginated<Garment> garments = await session.GetAssets<Garment>(
catalogue: myCatalogue.Id,
type: AssetType.garments,
style: Style.phr,
gender: Gender.male
);
// Hairs
Paginated<Hair> hairs = await session.GetAssets<Hair>(
catalogue: myCatalogue.Id,
type: AssetType.hairs,
style: Style.phr,
gender: Gender.male
);
// ...
}