Class CompositionLayerExtension
Abstract class used to define a composition layer extension. A CompositionLayerExtension
is a component that can be added to a game object that is already given an instance of
a Composition
By default this requires that the game object have a Composition
Inherited Members
Namespace: Unity.XR.CompositionLayers
Assembly: Unity.XR.CompositionLayers.dll
Syntax
[ExecuteAlways]
[RequireComponent(typeof(CompositionLayer))]
public abstract class CompositionLayerExtension : MonoBehaviour
Fields
ReportStateChange
Report state change for the Composition
Declaration
protected Action ReportStateChange
Field Value
Type | Description |
---|---|
Action |
Properties
Target
Implementations must specify which type of object this extension should be associated with.
Declaration
public abstract CompositionLayerExtension.ExtensionTarget Target { get; }
Property Value
Type | Description |
---|---|
Composition |
Methods
Awake()
MonoBehaviour is a base class that many Unity scripts derive from.
Declaration
public virtual void Awake()
GetNativeStructPtr()
Implementations must return a pointer to this extension's native struct.
Declaration
public abstract void* GetNativeStructPtr()
Returns
Type | Description |
---|---|
void* | the pointer to extension's native struct. |
Remarks
This method is called by the OpenXRLayerUtility GetExtensionsChain function when
it initializes an object's Next
pointer struct chain member. Layer handlers can
use this chain to access native extension properties.
OnDestroy()
MonoBehaviour is a base class that many Unity scripts derive from.
Declaration
public virtual void OnDestroy()
OnDisable()
MonoBehaviour is a base class that many Unity scripts derive from.
Declaration
public virtual void OnDisable()
OnEnable()
MonoBehaviour is a base class that many Unity scripts derive from.
Declaration
public virtual void OnEnable()
UpdateValue<T>(T, T)
Check if new value != old value. If it is, then report state change and return new value. Otherwise return old value
Declaration
protected T UpdateValue<T>(T oldValue, T newValue)
Parameters
Type | Name | Description |
---|---|---|
T | oldValue | Current value to check for equality |
T | newValue | The new value we want to change the old value to. |
Returns
Type | Description |
---|---|
T | Old value if new value is the same, otherwise the new value. |
Type Parameters
Name | Description |
---|---|
T | Type of old and new value. |