Astra Unity 2.6.6
Astra Unity Plugin
Astra.Catalog Class Reference

Catalog is used to search for assets such as clothing, hair, morphables, figures, avatars, and more. Querying can be filtered to find compatible items or unfiltered requiring you to ensure compatibility. Assets located here will come from both locally installed MR files and against your applications asset categories database from the web portal. If you cannot find an asset you were expecting verify that it is attached to your application through an asset category. If you know the Guid directly you can instead use the Asset.Loader class which will work as long as the asset is available to you regardless if it's associated to an asset category or not. More...

Classes

class  CatalogSearchOptions
 
class  SearchCatalogJob
 Job to search the catalog for a set of assets More...
 

Public Types

enum  CatalogError { Success = 0 , Failed }
 Used to determine a catalog request success of failure state More...
 
enum  AvatarRequest { All , App , User }
 Indicates the filter type for retrieving types of avatars (all, just application level, or just user level) More...
 

Static Public Member Functions

static ApiJobNoResult Refresh ()
 Triggers a refresh of assets from the back end. This should be used if you make updates to your assets in your admin portal and need those changes reflected after the initial query. This is automatically done for you on the first call to the catalog system and is only needed if you need to manually update while running your app. If you have a very long running app or it never quits (potentially on mobile) it is a good to trigger a Refresh on a timer or on an event such as resuming from a long sleep. More...
 
static SearchCatalogJob GetAvatars (AvatarRequest avatarRequest=AvatarRequest.All)
 Get the list of avatars assigned to the current user in this environment More...
 
static CatalogEntry CreateNewAvatarEntry (AvatarItem ai)
 Create a new catalog entry for a given AvatarItem, useful when a new avatar is created from a template avatar, such as creating a user avatar based on an app avatar. More...
 
static void UpdateCatalogEntryFromAvatarItem (CatalogEntry avatarCatalogEntry, AvatarItem ai)
 Update the CatalogEntry for an AvatarItem with an updated definition using the given AvatarItem. More...
 
static SearchCatalogJob SearchForFigures (AvatarItem avatar)
 Get the list of figures available to this environment More...
 
static SearchCatalogJob SearchForFigures (string rigAstraGuid)
 Get the list of figures available to this environment More...
 
static SearchCatalogJob SearchForClothing (AvatarItem avatar, List< string > clothingRegions)
 Get the list of clothing items available to this environment for the given clothing regions More...
 
static SearchCatalogJob SearchForClothing (string rigAstraGuid, List< string > clothingRegions)
 Get the list of clothing items available to this environment for the given clothing regions More...
 
static SearchCatalogJob SearchForHair (AvatarItem avatar, List< string > hairRegions)
 Get the list of hair items available to this environment for the given hair regions More...
 
static SearchCatalogJob SearchForHair (string rigAstraGuid, List< string > hairRegions)
 Get the list of hair items available to this environment for the given hair regions More...
 
static SearchCatalogJob SearchForMorphables (AvatarItem avatar, List< string > regions=null)
 Get the list of morphable items available to this environment for this avatar. More...
 
static SearchCatalogJob SearchForMorphables (string rigAstraGuid, string meshAstraGuid, List< string > regions=null)
 Get the list of morphable items available to this environment for this avatar. More...
 
static SearchCatalogJob SearchForDecals (AvatarItem avatar, List< string > decalRegions=null)
 Get the list of decal items available to this environment for this avatar More...
 
static SearchCatalogJob SearchForDecals (string meshAstraGuid, List< string > decalRegions=null)
 Get the list of decal items available to this environment for this avatar More...
 
static SearchCatalogJob SearchForCollectionItems (AvatarItem avatar)
 Get the list of collection items available to this environment for this avatar More...
 
static SearchCatalogJob SearchForCollectionItems (string rigAstraGuid)
 Get the list of collection items available to this environment for this avatar More...
 
static SearchCatalogJob FindAssetByGuid (string guid)
 Finds a specific asset by guid More...
 
static SearchCatalogJob FindAssets (CatalogSearchOptions searchOptions)
 Finds a specific asset by search options More...
 
static DeleteAvatarJob DeleteAvatar (string guid, int parentJobId=Job.kNoParentJobId)
 Deletes the given avatar from the service, this is permanent and not reversible More...
 
static string GenerateAstraGuid ()
 Generate a random Guid for a new astra item, these are generated system side and are not verified for uniqueness via servers More...
 
static SyncAssetsJob SyncAssets (bool installMissing=false)
 Installs assets that have remote updates on the network (the remote asset was updated after the local asset was installed) More...
 
static ApiJobNoResult DownloadAllAssetsOfType (SchematicType type, List< string > tags=null)
 Ensures that we have downloaded all of the assets available for a given type More...
 
static List< string > GetAllAssetsForAvatar (CatalogEntry avatarCatalogEntry)
 Retrieves the list of Asset Guids that are part of this avatar. Note that the avatar does not need to be loaded for this operation. More...
 
static ApiJobNoResult DownloadAllAssetsForAvatar (CatalogEntry avatarCatalogEntry)
 Begin downloading all assets attached to a given Avatar Note that the avatar does not need to be loaded for this operation. More...
 
static ApiJobNoResult DownloadAssets (List< string > guids)
 Begin downloading a set of assets More...
 
static ApiJobNoResult DownloadAsset (string guid)
 Begin downloading a asset More...
 
static GetAssetCategoryJob GetAssetCategory (long categoryId, bool images, int parentJobId=Job.kNoParentJobId)
 Finds category information typically queried against the root category which you can find on the web portal for your Asset Categories. Categories can contain things such as sort order, titles, if they should be hidden, icons, etc. More...
 

Detailed Description

Catalog is used to search for assets such as clothing, hair, morphables, figures, avatars, and more. Querying can be filtered to find compatible items or unfiltered requiring you to ensure compatibility. Assets located here will come from both locally installed MR files and against your applications asset categories database from the web portal. If you cannot find an asset you were expecting verify that it is attached to your application through an asset category. If you know the Guid directly you can instead use the Asset.Loader class which will work as long as the asset is available to you regardless if it's associated to an asset category or not.

Member Enumeration Documentation

◆ AvatarRequest

Indicates the filter type for retrieving types of avatars (all, just application level, or just user level)

Enumerator
All 

Use this when you want both app avatars and user avatars

App 

Use this to only get app level avatars, these are read-only type avatars made by the developer and not users

User 

Use this to only get user level avatars, these are made by the currently logged in user, if not logged in as a user has no effect

◆ CatalogError

Used to determine a catalog request success of failure state

Enumerator
Success 

Indicates that the request succeeded (regardless of how many results are generated)

Failed 

A failure of some kind has occurred, typically you will need to lookup the error in the logs to determine the problem

Member Function Documentation

◆ CreateNewAvatarEntry()

static CatalogEntry Astra.Catalog.CreateNewAvatarEntry ( AvatarItem  ai)
inlinestatic

Create a new catalog entry for a given AvatarItem, useful when a new avatar is created from a template avatar, such as creating a user avatar based on an app avatar.

Parameters
aiAvatar item to create an entry for

◆ DeleteAvatar()

static DeleteAvatarJob Astra.Catalog.DeleteAvatar ( string  guid,
int  parentJobId = Job.kNoParentJobId 
)
inlinestatic

Deletes the given avatar from the service, this is permanent and not reversible

Parameters
guidGuid of the Avatar to be deleted
parentJobIdId of the parent job, if it applies. Optional.

◆ DownloadAllAssetsForAvatar()

static ApiJobNoResult Astra.Catalog.DownloadAllAssetsForAvatar ( CatalogEntry  avatarCatalogEntry)
inlinestatic

Begin downloading all assets attached to a given Avatar Note that the avatar does not need to be loaded for this operation.

Parameters
avatarCatalogEntryCatalogEntry for the avatar
Returns

◆ DownloadAllAssetsOfType()

static ApiJobNoResult Astra.Catalog.DownloadAllAssetsOfType ( SchematicType  type,
List< string >  tags = null 
)
inlinestatic

Ensures that we have downloaded all of the assets available for a given type

Parameters
typeType of asset to download
tagsAny tags to use as part of the call
Returns

◆ DownloadAsset()

static ApiJobNoResult Astra.Catalog.DownloadAsset ( string  guid)
inlinestatic

Begin downloading a asset

Parameters
guidguid of asset to download

◆ DownloadAssets()

static ApiJobNoResult Astra.Catalog.DownloadAssets ( List< string >  guids)
inlinestatic

Begin downloading a set of assets

Parameters
guidsList of guids for assets to download

◆ FindAssetByGuid()

static SearchCatalogJob Astra.Catalog.FindAssetByGuid ( string  guid)
inlinestatic

Finds a specific asset by guid

Parameters
guidAstraGuid of the asset to find

◆ FindAssets()

static SearchCatalogJob Astra.Catalog.FindAssets ( CatalogSearchOptions  searchOptions)
inlinestatic

Finds a specific asset by search options

Parameters
searchOptionsOptions to search by
Returns

◆ GenerateAstraGuid()

static string Astra.Catalog.GenerateAstraGuid ( )
inlinestatic

Generate a random Guid for a new astra item, these are generated system side and are not verified for uniqueness via servers

Returns
The randomly generated GUID as a string

◆ GetAllAssetsForAvatar()

static List< string > Astra.Catalog.GetAllAssetsForAvatar ( CatalogEntry  avatarCatalogEntry)
inlinestatic

Retrieves the list of Asset Guids that are part of this avatar. Note that the avatar does not need to be loaded for this operation.

Parameters
avatarCatalogEntryCatalogEntry for the avatar

◆ GetAssetCategory()

static GetAssetCategoryJob Astra.Catalog.GetAssetCategory ( long  categoryId,
bool  images,
int  parentJobId = Job.kNoParentJobId 
)
inlinestatic

Finds category information typically queried against the root category which you can find on the web portal for your Asset Categories. Categories can contain things such as sort order, titles, if they should be hidden, icons, etc.

Parameters
categoryIdCategory ID. -1 to retrieve all category hierarchy
imagesCategory images will be included
parentJobIdId of the parent job, if it applies. Optional.
Returns

A job to wait upon where GetResult will contain a sorted dictionary keyed on id (ulong) and value will be Astra.Net.GetAssetCategoryJob.AssetCategory

Example: QueryingCatalog.cs

◆ GetAvatars()

static SearchCatalogJob Astra.Catalog.GetAvatars ( AvatarRequest  avatarRequest = AvatarRequest.All)
inlinestatic

Get the list of avatars assigned to the current user in this environment

Parameters
avatarRequestIndicate which set of Avatars you would like to get results for: Avatars that are common as part of the app, avatars that are specific to the currently signed in user, or all. Default is all.
Returns
A job with the results

◆ Refresh()

static ApiJobNoResult Astra.Catalog.Refresh ( )
inlinestatic

Triggers a refresh of assets from the back end. This should be used if you make updates to your assets in your admin portal and need those changes reflected after the initial query. This is automatically done for you on the first call to the catalog system and is only needed if you need to manually update while running your app. If you have a very long running app or it never quits (potentially on mobile) it is a good to trigger a Refresh on a timer or on an event such as resuming from a long sleep.

Returns
An empty job that you can wait upon until the catalog is refreshed

◆ SearchForClothing() [1/2]

static SearchCatalogJob Astra.Catalog.SearchForClothing ( AvatarItem  avatar,
List< string >  clothingRegions 
)
inlinestatic

Get the list of clothing items available to this environment for the given clothing regions

Parameters
avatarIf not null, the figures returned will be compatible with this AvatarItem
clothingRegionsList of clothing regions to find clothing items for

◆ SearchForClothing() [2/2]

static SearchCatalogJob Astra.Catalog.SearchForClothing ( string  rigAstraGuid,
List< string >  clothingRegions 
)
inlinestatic

Get the list of clothing items available to this environment for the given clothing regions

Parameters
rigAstraGuidThe Astra Guid for the rig to filter assets on
clothingRegionsList of clothing regions to find clothing items for

◆ SearchForCollectionItems() [1/2]

static SearchCatalogJob Astra.Catalog.SearchForCollectionItems ( AvatarItem  avatar)
inlinestatic

Get the list of collection items available to this environment for this avatar

Parameters
avatarIf not null, the figures returned will be compatible with this AvatarItem

◆ SearchForCollectionItems() [2/2]

static SearchCatalogJob Astra.Catalog.SearchForCollectionItems ( string  rigAstraGuid)
inlinestatic

Get the list of collection items available to this environment for this avatar

Parameters
rigAstraGuidThe Astra Guid for the rig to filter assets on

◆ SearchForDecals() [1/2]

static SearchCatalogJob Astra.Catalog.SearchForDecals ( AvatarItem  avatar,
List< string >  decalRegions = null 
)
inlinestatic

Get the list of decal items available to this environment for this avatar

Parameters
avatarIf not null, the figures returned will be compatible with this AvatarItem
decalRegionsIf not null, the list of regions to find decals for

◆ SearchForDecals() [2/2]

static SearchCatalogJob Astra.Catalog.SearchForDecals ( string  meshAstraGuid,
List< string >  decalRegions = null 
)
inlinestatic

Get the list of decal items available to this environment for this avatar

Parameters
meshAstraGuidThe Astra Guid for the mesh to filter assets on
decalRegionsIf not null, the list of regions to find decals for

◆ SearchForFigures() [1/2]

static SearchCatalogJob Astra.Catalog.SearchForFigures ( AvatarItem  avatar)
inlinestatic

Get the list of figures available to this environment

Parameters
avatarIf not null, the figures returned will be compatible with this AvatarItem

◆ SearchForFigures() [2/2]

static SearchCatalogJob Astra.Catalog.SearchForFigures ( string  rigAstraGuid)
inlinestatic

Get the list of figures available to this environment

Parameters
rigAstraGuidThe Astra Guid for the rig to filter assets on

◆ SearchForHair() [1/2]

static SearchCatalogJob Astra.Catalog.SearchForHair ( AvatarItem  avatar,
List< string >  hairRegions 
)
inlinestatic

Get the list of hair items available to this environment for the given hair regions

Parameters
avatarIf not null, the figures returned will be compatible with this AvatarItem
hairRegionsList of regions to find hair items for

◆ SearchForHair() [2/2]

static SearchCatalogJob Astra.Catalog.SearchForHair ( string  rigAstraGuid,
List< string >  hairRegions 
)
inlinestatic

Get the list of hair items available to this environment for the given hair regions

Parameters
rigAstraGuidThe Astra Guid for the rig to filter assets on
hairRegionsList of regions to find hair items for

◆ SearchForMorphables() [1/2]

static SearchCatalogJob Astra.Catalog.SearchForMorphables ( AvatarItem  avatar,
List< string >  regions = null 
)
inlinestatic

Get the list of morphable items available to this environment for this avatar.

Parameters
avatarIf not null, the figures returned will be compatible with this AvatarItem
regionsList of regions to find morphable items for

◆ SearchForMorphables() [2/2]

static SearchCatalogJob Astra.Catalog.SearchForMorphables ( string  rigAstraGuid,
string  meshAstraGuid,
List< string >  regions = null 
)
inlinestatic

Get the list of morphable items available to this environment for this avatar.

Parameters
rigAstraGuidThe Astra Guid for the rig to filter assets on
meshAstraGuidThe Astra Guid for the mesh to filter assets on
regionsList of regions to find morphable items for

◆ SyncAssets()

static SyncAssetsJob Astra.Catalog.SyncAssets ( bool  installMissing = false)
inlinestatic

Installs assets that have remote updates on the network (the remote asset was updated after the local asset was installed)

Parameters
installMissingIf true will also install ALL assets that are available, defaults to false

◆ UpdateCatalogEntryFromAvatarItem()

static void Astra.Catalog.UpdateCatalogEntryFromAvatarItem ( CatalogEntry  avatarCatalogEntry,
AvatarItem  ai 
)
inlinestatic

Update the CatalogEntry for an AvatarItem with an updated definition using the given AvatarItem.

Parameters
avatarCatalogEntryAvatar CatalogEntry to update
aiAvatar Item to use to set the updated values

The documentation for this class was generated from the following file: