Class CompositionLayerUtils
Collection of utility methods that are useful for Composition
Inherited Members
Namespace: Unity.XR.CompositionLayers .Services
Assembly: Unity.XR.CompositionLayers.dll
Syntax
public static class CompositionLayerUtils
Methods
AddSuggestedExtensions(CompositionLayer)
Adds the components listed in the Suggestedlayer
's GameObject.
Declaration
public static void AddSuggestedExtensions(this CompositionLayer layer)
Parameters
Type | Name | Description |
---|---|---|
Composition |
layer | The Composition |
CanChangeOrderTo(CompositionLayer, int)
Checks if the Compositionlayer
be changed to the order
value.
Declaration
public static bool CanChangeOrderTo(this CompositionLayer layer, int order)
Parameters
Type | Name | Description |
---|---|---|
Composition |
layer | The Composition |
int | order | The value to check if the |
Returns
Type | Description |
---|---|
bool |
|
CreateLayerData(string)
Uses typeFullName
to find the Layer
Declaration
public static LayerData CreateLayerData(string typeFullName)
Parameters
Type | Name | Description |
---|---|---|
string | typeFullName | The type's full name that corresponds to a Layer |
Returns
Type | Description |
---|---|
Layer |
If the |
CreateLayerData(Type)
Uses type to find the Layer
Declaration
public static LayerData CreateLayerData(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type of the Layer Data |
Returns
Type | Description |
---|---|
Layer |
If the |
GetAllLayerDescriptors()
Gets a new copy of a list including all known Layer
Declaration
public static List<LayerDataDescriptor> GetAllLayerDescriptors()
Returns
Type | Description |
---|---|
List<Layer |
A list of all known Layer |
GetLayerDescriptor(string)
Gets the LayerDataDescriptor
that matches typeFullName
.
Declaration
public static LayerDataDescriptor GetLayerDescriptor(string typeFullName)
Parameters
Type | Name | Description |
---|---|---|
string | typeFullName | Id of the corresponding Layer |
Returns
Type | Description |
---|---|
Layer |
The Layer |
GetLayerDescriptor(Type)
Gets the LayerType
type
.
Declaration
public static LayerDataDescriptor GetLayerDescriptor(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The |
Returns
Type | Description |
---|---|
Layer |
The Layer |
TryChangeLayerOrder(CompositionLayer, int, int)
Try to change the layer
's order and update the order registered with the
CompositionoldOrder
to a new order value newOrder
.
Declaration
public static bool TryChangeLayerOrder(this CompositionLayer layer, int oldOrder, int newOrder)
Parameters
Type | Name | Description |
---|---|---|
Composition |
layer | The Composition |
int | oldOrder | The old Composition |
int | newOrder | The new Composition |
Returns
Type | Description |
---|---|
bool | Returns |
TrySwapLayers(CompositionLayer, CompositionLayer)
Tries to swap the Order values of lhl
and rhl
.
Declaration
public static bool TrySwapLayers(this CompositionLayer lhl, CompositionLayer rhl)
Parameters
Type | Name | Description |
---|---|---|
Composition |
lhl | Left hand Composition |
Composition |
rhl | Right hand Composition |
Returns
Type | Description |
---|---|
bool |
|