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
importerId
GuidThe 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
stringThe 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
typeName
string
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
extension
stringThe 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
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
null
otherwise.
GetContentType(Type)
public static Type GetContentType(Type assetType)
Parameters
assetType
Type
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
assetType
TypeThe 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
TypeThe 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
GetPackageUpgrader(string)
public static PackageUpgrader GetPackageUpgrader(string packageName)
Parameters
packageName
string
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
extension
stringThe 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
TypeType of the asset.
throwException
boolA 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
TypeType of the asset.
throwException
boolA 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
IsContentType(Type)
public static bool IsContentType(Type type)
Parameters
type
Type
Returns
IsProjectAssetFileExtension(string)
public static bool IsProjectAssetFileExtension(string extension)
Parameters
extension
string
Returns
IsProjectCodeGeneratorAssetFileExtension(string)
public static bool IsProjectCodeGeneratorAssetFileExtension(string extension)
Parameters
extension
string
Returns
RegisterImporter(IAssetImporter)
Registers a IAssetImporter for the specified asset type.
public static void RegisterImporter(IAssetImporter importer)
Parameters
importer
IAssetImporterThe 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