Class AssetManagerClient
Provides executing operations on the Asset Manager.
Inherited Members
Namespace: Unity.AssetManager.Editor
Assembly: Unity.AssetManager.Core.Editor.dll
Syntax
public static class AssetManagerClient
Methods
GetImportedAssetGUIDs(string)
Returns the Unity GUIDs associated with the given asset identifier
Declaration
public static IEnumerable<GUID> GetImportedAssetGUIDs(string assetId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | assetId | The asset identifier. |
Returns
| Type | Description |
|---|---|
| IEnumerable<GUID> | If the given asset identifier is tracked, return all Unity GUIDs related to this asset. Else, return an empty enumerable |
GetMetadataKeyFromDisplayNameAsync(string, CancellationToken)
Returns the key for a metadata field based on its display name.
Declaration
public static Task<string> GetMetadataKeyFromDisplayNameAsync(string displayName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | displayName | The display name of the metadata field. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<string> | The key for a metadata field. |
GetUserIdsFromUserNameAsync(string, CancellationToken)
Returns the user ID for the specified user name.
Declaration
public static Task<IEnumerable<string>> GetUserIdsFromUserNameAsync(string userName, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userName | A user name to convert to id(s). |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<string>> | The list of user ids. |
Remarks
Because the user name may not be unique, this method may return multiple user IDs.
ImportAsync(IEnumerable<string>, ImportSettings, CancellationToken)
Triggers an import operation for the specified assets.
Declaration
public static Task<ImportResult> ImportAsync(IEnumerable<string> assetIds, ImportSettings settings = default, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<string> | assetIds | An enumeration of asset ids. |
| ImportSettings | settings | Additional information for the import. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<ImportResult> | A task with no result. |
ImportAsync(ImportSearchFilter, ImportSettings, CancellationToken)
Triggers an import operation for assets matching the specified search filter.
Declaration
public static Task<ImportResult> ImportAsync(ImportSearchFilter filter, ImportSettings settings = default, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| ImportSearchFilter | filter | A search filter which targets assets for import. |
| ImportSettings | settings | Additional information for the import. |
| CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
| Type | Description |
|---|---|
| Task<ImportResult> | A task with no result. |