Table of Contents

Class AssetRegistry

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll

A registry for various content associated with assets.

public static class AssetRegistry
Inheritance
AssetRegistry

Properties

AssetAssemblies

Gets the list of asset assemblies currently registered.

public static IEnumerable<Assembly> AssetAssemblies { get; }

Property Value

IEnumerable<Assembly>

EngineAssemblies

Gets the list of engine assemblies currently registered.

public static IEnumerable<Assembly> EngineAssemblies { get; }

Property Value

IEnumerable<Assembly>

RegisteredImporters

Gets an enumeration of registered importers.

public static IEnumerable<IAssetImporter> RegisteredImporters { get; }

Property Value

IEnumerable<IAssetImporter>

The registered importers.

SupportedPlatforms

Gets the supported platforms.

public static SolutionPlatformCollection SupportedPlatforms { get; }

Property Value

SolutionPlatformCollection

The supported platforms.

Methods

FindImporterById(Guid)

Finds an importer by its id.

public static IAssetImporter FindImporterById(Guid importerId)

Parameters

importerId Guid

The importer identifier.

Returns

IAssetImporter

An instance of the importer of null if not found.

FindImporterForFile(string)

Finds the importer associated with an asset by the file of the file to import.

public static IEnumerable<IAssetImporter> FindImporterForFile(string file)

Parameters

file string

The file to import.

Returns

IEnumerable<IAssetImporter>

An instance of the importer of null if not found.

GetAllAssetFactories()

public static IEnumerable<IAssetFactory<Asset>> GetAllAssetFactories()

Returns

IEnumerable<IAssetFactory<Asset>>

GetAssetFactory(string)

public static IAssetFactory<Asset> GetAssetFactory(string typeName)

Parameters

typeName string

Returns

IAssetFactory<Asset>

GetAssetTypeFromFileExtension(string)

Gets the asset type from the extension. If no asset type is found, return null.

public static Type GetAssetTypeFromFileExtension(string extension)

Parameters

extension string

The extension of the asset file.

Returns

Type

Type of the associated asset or null if not found.

GetAssetTypes(Type)

public static IReadOnlyList<Type> GetAssetTypes(Type contentType)

Parameters

contentType Type

Returns

IReadOnlyList<Type>

GetAssetUpgraders(Type, string)

Gets the AssetUpgraderCollection of an asset type, if available.

public static AssetUpgraderCollection GetAssetUpgraders(Type assetType, string dependencyName)

Parameters

assetType Type

The asset type.

dependencyName string

The dependency name.

Returns

AssetUpgraderCollection

The AssetUpgraderCollection of an asset type if available, or null otherwise.

GetContentType(Type)

public static Type GetContentType(Type assetType)

Parameters

assetType Type

Returns

Type

GetContentTypes()

public static IList<Type> GetContentTypes()

Returns

IList<Type>

GetCurrentFormatVersions(Type)

Gets the current format version of an asset.

public static SortedList<string, PackageVersion> GetCurrentFormatVersions(Type assetType)

Parameters

assetType Type

The asset type.

Returns

SortedList<string, PackageVersion>

The current format version of this asset.

GetDataVisitNodes()

public static IEnumerable<IDataCustomVisitor> GetDataVisitNodes()

Returns

IEnumerable<IDataCustomVisitor>

GetDefaultExtension(Type)

Gets the default file associated with an asset.

public static string GetDefaultExtension(Type assetType)

Parameters

assetType Type

The type.

Returns

string

System.String.

GetDefaultExtension<T>()

Gets the default file associated with an asset.

public static string GetDefaultExtension<T>() where T : Asset

Returns

string

System.String.

Type Parameters

T

Type of the asset.

GetPackageSessionAnalysisTypes()

public static IEnumerable<Type> GetPackageSessionAnalysisTypes()

Returns

IEnumerable<Type>

GetPackageUpgrader(string)

public static PackageUpgrader GetPackageUpgrader(string packageName)

Parameters

packageName string

Returns

PackageUpgrader

GetPublicTypes()

Returns an array of asset types that are non-abstract and public.

public static Type[] GetPublicTypes()

Returns

Type[]

An array of Type elements.

IsAssetFileExtension(string)

Determines whether the file is an asset file type.

public static bool IsAssetFileExtension(string extension)

Parameters

extension string

The file.

Returns

bool

true if [is asset file file] [the specified file]; otherwise, false.

IsAssetOrPackageType(Type, bool)

Check if the specified type is an asset.

public static bool IsAssetOrPackageType(Type assetType, bool throwException = false)

Parameters

assetType Type

Type of the asset.

throwException bool

A boolean indicating whether this method should throw an exception if the type is not an asset type.

Returns

bool

true if the asset is an asset type, false otherwise.

IsAssetType(Type, bool)

Check if the specified type is an asset.

public static bool IsAssetType(Type assetType, bool throwException = false)

Parameters

assetType Type

Type of the asset.

throwException bool

A boolean indicating whether this method should throw an exception if the type is not an asset type.

Returns

bool

true if the asset is an asset type, false otherwise.

IsAssetTypeAlwaysMarkAsRoot(Type)

public static bool IsAssetTypeAlwaysMarkAsRoot(Type type)

Parameters

type Type

Returns

bool

IsContentType(Type)

public static bool IsContentType(Type type)

Parameters

type Type

Returns

bool

IsProjectAssetFileExtension(string)

public static bool IsProjectAssetFileExtension(string extension)

Parameters

extension string

Returns

bool

IsProjectCodeGeneratorAssetFileExtension(string)

public static bool IsProjectCodeGeneratorAssetFileExtension(string extension)

Parameters

extension string

Returns

bool

RegisterImporter(IAssetImporter)

Registers a IAssetImporter for the specified asset type.

public static void RegisterImporter(IAssetImporter importer)

Parameters

importer IAssetImporter

The importer.

Exceptions

ArgumentNullException

importer

RegisterSupportedPlatforms(List<SolutionPlatform>)

Registers the supported platforms.

public static void RegisterSupportedPlatforms(List<SolutionPlatform> platforms)

Parameters

platforms List<SolutionPlatform>

The platforms.

Exceptions

ArgumentNullException

platforms