Class UrlReferenceHelper
- Namespace
- Stride.Core.Serialization
- Assembly
- Stride.Core.Serialization.dll
A Helper class for UrlReference and UrlReference<T>.
public static class UrlReferenceHelper
- Inheritance
-
UrlReferenceHelper
Methods
CreateReference(Type, AssetId, string)
Creates a url reference to the given asset that matches the given reference type.
public static object CreateReference(Type referenceType, AssetId assetId, string assetUrl)
Parameters
referenceTypeTypeThe type of reference to create.
assetIdAssetIdThe target asset id to create.
assetUrlstringThe target asset url to create.
Returns
- object
A url reference to the given asset if it's not null and
referenceTypeis a valid reference url type, null otherwise.
Remarks
A reference type is either an UrlReference or a UrlReference<T>.
GetTargetContentType(Type)
Gets the asset content type for a given url reference type.
public static Type GetTargetContentType(Type type)
Parameters
typeTypeThe type is an url reference type, either an UrlReference or a UrlReference<T>
Returns
- Type
The target content type or null.
IsGenericUrlReferenceType(Type)
Checks if the given type is a UrlReference<T>
public static bool IsGenericUrlReferenceType(Type type)
Parameters
typeTypeThe type to test.
Returns
IsUrlReferenceType(Type)
Checks if the given type is either an UrlReference or a UrlReference<T>
public static bool IsUrlReferenceType(Type type)
Parameters
typeTypeThe type to test.