Class CompositionLayer
Base class for all composition layer types. Derive from this and extend to add your own layer type.
Inherited Members
Namespace: Unity.XR.CompositionLayers
Assembly: Unity.XR.CompositionLayers.dll
Syntax
[ExecuteAlways]
[DisallowMultipleComponent]
[AddComponentMenu("XR/Composition Layers/Composition Layer")]
[Icon("Packages/com.unity.xr.compositionlayers/Editor/Icons/d_LayerUniversal.png")]
[DefaultExecutionOrder(-2147483648)]
public sealed class CompositionLayer : MonoBehaviour
Properties
Extensions
Provides access to the list of Composition
Declaration
public List<CompositionLayerExtension> Extensions { get; }
Property Value
Type | Description |
---|---|
List<Composition |
LayerData
The data associated with the layer type this layer is set to.
Declaration
public LayerData LayerData { get; }
Property Value
Type | Description |
---|---|
Layer |
ScriptableObject instance for layer data. |
Order
The layer ordering of this layer in relation to the main eye layer. Order less than 0 will render under the eye layer in ascending order. Order greater than or equal to 0 will render over the eye layer in ascending order.
Declaration
public int Order { get; set; }
Property Value
Type | Description |
---|---|
int |
OrderInitialized
Order Initialized is used to track if the Order is initialized to a valid value.
A Order has been initialized when the Composition
Declaration
public bool OrderInitialized { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
ChangeLayerDataType(string)
Will populate the layer data with existing data associated with that typeFullName
.
Declaration
public void ChangeLayerDataType(string typeFullName)
Parameters
ChangeLayerDataType(Type)
Sets the Layer
Declaration
public void ChangeLayerDataType(Type type)
Parameters
ChangeLayerDataType(LayerData)
Sets the Layer
Declaration
public void ChangeLayerDataType(LayerData layer)
Parameters
ChangeLayerDataType(LayerDataDescriptor)
Sets the layer type from the Layer
Declaration
public void ChangeLayerDataType(LayerDataDescriptor descriptor)
Parameters
Type | Name | Description |
---|---|---|
Layer |
descriptor | The Layer |
ChangeLayerDataType<T>()
Sets the Layer
Declaration
public void ChangeLayerDataType<T>() where T : LayerData
Type Parameters
Name | Description |
---|---|
T | The type of Layer |
GetPlatformLayerData<T>()
Get/Desrialize PlatformLayerData. This function keeps deselized PlatformLayerData internally.
Declaration
public T GetPlatformLayerData<T>() where T : PlatformLayerData
Returns
Type | Description |
---|---|
T | PlatformLayerData. |
Type Parameters
Name | Description |
---|---|
T | The type of PlatformLayerData changed to. |
SetPlatformLayerData(PlatformLayerData)
Set/Serialize PlatformLayerData.
Declaration
public void SetPlatformLayerData(PlatformLayerData platformLayerData)
Parameters
Type | Name | Description |
---|---|---|
Platform |
platformLayerData | Target PlatformLayerData. |