Class LinkXmlGenerator
This can be used to create a LinkXml for your build. This will ensure that the desired runtime types are packed into the build.
Inherited Members
Namespace: UnityEditor.Build.Pipeline.Utilities
Assembly: Unity.ScriptableBuildPipeline.Editor.dll
Syntax
public class LinkXmlGenerator
Fields
serializedClassesPerAssembly
Obsolete, no longer does anything.
Declaration
[Obsolete]
protected Dictionary<string, HashSet<string>> serializedClassesPerAssembly
Field Value
Type | Description |
---|---|
Dictionary<string, HashSet<string>> |
Methods
AddAssemblies(IEnumerable<Assembly>)
Add runtime assembly to the LinkXml Generator.
Declaration
public void AddAssemblies(IEnumerable<Assembly> assemblies)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Assembly> | assemblies | The desired runtime assemblies. |
AddAssemblies(params Assembly[])
Add runtime assembly to the LinkXml Generator.
Declaration
public void AddAssemblies(params Assembly[] assemblies)
Parameters
Type | Name | Description |
---|---|---|
Assembly[] | assemblies | The desired runtime assemblies. |
AddSerializedClass(IEnumerable<string>)
Add SerializedReference class type from fully qualified name to the Generator, those will end up in PreservedTypes.xml
Declaration
public void AddSerializedClass(IEnumerable<string> serializedRefTypes)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | serializedRefTypes | The SerializeReference instance fully qualified name we want to preserve. |
AddTypes(IEnumerable<Type>)
Add runtime type to the LinkXml Generator.
Declaration
public void AddTypes(IEnumerable<Type> types)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Type> | types | The desired runtime types. |
AddTypes(params Type[])
Add runtime type to the LinkXml Generator.
Declaration
public void AddTypes(params Type[] types)
Parameters
Type | Name | Description |
---|---|---|
Type[] | types | The desired runtime types. |
CreateDefault()
Constructs and returns a LinkXmlGenerator object that contains default UnityEditor to UnityEngine type conversions.
Declaration
public static LinkXmlGenerator CreateDefault()
Returns
Type | Description |
---|---|
LinkXmlGenerator | LinkXmlGenerator object with the default UnityEngine type conversions. |
GetEditorTypeConversions()
Returns the set of UnityEditor types that have valid runtime direct mappings.
Declaration
public static KeyValuePair<Type, Type>[] GetEditorTypeConversions()
Returns
Type | Description |
---|---|
KeyValuePair<Type, Type>[] | Array of KeyValuePairs containing the editor type and it's equivalent runtime type. |
Save(string)
Save the LinkXml to the specified path.
Declaration
public void Save(string path)
Parameters
Type | Name | Description |
---|---|---|
string | path | The path to save the linker xml file. |
SetTypeConversion(Type, Type)
Setup runtime type conversion
Declaration
public void SetTypeConversion(Type a, Type b)
Parameters
Type | Name | Description |
---|---|---|
Type | a | Convert from type. |
Type | b | Convert to type. |