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
referenceType
TypeThe type of reference to create.
assetId
AssetIdThe target asset id to create.
assetUrl
stringThe target asset url to create.
Returns
- object
A url reference to the given asset if it's not null and
referenceType
is 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
type
TypeThe 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
type
TypeThe 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
type
TypeThe type to test.