Class AssetRegistry
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
EngineAssemblies
Gets the list of engine assemblies currently registered.
public static IEnumerable<Assembly> EngineAssemblies { get; }
Property Value
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
importerIdGuidThe 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
filestringThe file to import.
Returns
- IEnumerable<IAssetImporter>
An instance of the importer of null if not found.
GetAllAssetFactories()
public static IEnumerable<IAssetFactory<Asset>> GetAllAssetFactories()
Returns
GetAssetFactory(string)
public static IAssetFactory<Asset> GetAssetFactory(string typeName)
Parameters
typeNamestring
Returns
GetAssetTypeFromFileExtension(string)
Gets the asset type from the extension. If no asset type is found, return null.
public static Type GetAssetTypeFromFileExtension(string extension)
Parameters
extensionstringThe 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
contentTypeType
Returns
GetAssetUpgraders(Type, string)
Gets the AssetUpgraderCollection of an asset type, if available.
public static AssetUpgraderCollection GetAssetUpgraders(Type assetType, string dependencyName)
Parameters
Returns
- AssetUpgraderCollection
The AssetUpgraderCollection of an asset type if available, or
nullotherwise.
GetContentType(Type)
public static Type GetContentType(Type assetType)
Parameters
assetTypeType
Returns
GetContentTypes()
public static IList<Type> GetContentTypes()
Returns
GetCurrentFormatVersions(Type)
Gets the current format version of an asset.
public static SortedList<string, PackageVersion> GetCurrentFormatVersions(Type assetType)
Parameters
assetTypeTypeThe 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
assetTypeTypeThe 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
TType of the asset.
GetPackageSessionAnalysisTypes()
public static IEnumerable<Type> GetPackageSessionAnalysisTypes()
Returns
GetPackageUpgrader(string)
public static PackageUpgrader GetPackageUpgrader(string packageName)
Parameters
packageNamestring
Returns
GetPublicTypes()
Returns an array of asset types that are non-abstract and public.
public static Type[] GetPublicTypes()
Returns
IsAssetFileExtension(string)
Determines whether the file is an asset file type.
public static bool IsAssetFileExtension(string extension)
Parameters
extensionstringThe file.
Returns
- bool
trueif [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
assetTypeTypeType of the asset.
throwExceptionboolA boolean indicating whether this method should throw an exception if the type is not an asset type.
Returns
- bool
trueif 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
assetTypeTypeType of the asset.
throwExceptionboolA boolean indicating whether this method should throw an exception if the type is not an asset type.
Returns
- bool
trueif the asset is an asset type, false otherwise.
IsAssetTypeAlwaysMarkAsRoot(Type)
public static bool IsAssetTypeAlwaysMarkAsRoot(Type type)
Parameters
typeType
Returns
IsContentType(Type)
public static bool IsContentType(Type type)
Parameters
typeType
Returns
IsProjectAssetFileExtension(string)
public static bool IsProjectAssetFileExtension(string extension)
Parameters
extensionstring
Returns
IsProjectCodeGeneratorAssetFileExtension(string)
public static bool IsProjectCodeGeneratorAssetFileExtension(string extension)
Parameters
extensionstring
Returns
RegisterImporter(IAssetImporter)
Registers a IAssetImporter for the specified asset type.
public static void RegisterImporter(IAssetImporter importer)
Parameters
importerIAssetImporterThe importer.
Exceptions
- ArgumentNullException
importer
RegisterSupportedPlatforms(List<SolutionPlatform>)
Registers the supported platforms.
public static void RegisterSupportedPlatforms(List<SolutionPlatform> platforms)
Parameters
platformsList<SolutionPlatform>The platforms.
Exceptions
- ArgumentNullException
platforms