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 typeFullName matches a Layernull is returned.
|
CreateLayerData(Type)
Uses type to find the Layer
Declaration
public static LayerData CreateLayerData(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
Layer |
If the type matches a Layernull is returned.
|
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)
Declaration
public static LayerDataDescriptor GetLayerDescriptor(string typeFullName)
Parameters
Type | Name | Description |
---|---|---|
string | typeFullName | Id of the corresponding Layer |
Returns
Type | Description |
---|---|
Layer |
The Layer
typeFullName provided. If the is empty or the
Layer |
GetLayerDescriptor(Type)
Declaration
public static LayerDataDescriptor GetLayerDescriptor(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The of the corresponding Layer |
Returns
Type | Description |
---|---|
Layer |
The Layer type
provided. If the is not a subclass of 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 if the layer is set to the newOrder or is already set to
newOrder .
|
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 | if the method was able to swap the lhl and rhl
|