docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class LayerData

    Base class for all layer data objects. Every layer needs to be defined by one data object even if it's just a simple subclass of LayerData.

    Inheritance
    object
    LayerData
    CubeProjectionLayerData
    CylinderLayerData
    DefaultLayerData
    EquirectMeshLayerData
    ProjectionLayerData
    ProjectionLayerRigData
    QuadLayerData
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.XR.CompositionLayers.Layers
    Assembly: Unity.XR.CompositionLayers.dll
    Syntax
    [Serializable]
    public class LayerData

    Fields

    ReportStateChange

    Report state change for the CompositionLayer associated with this LayerData.

    Declaration
    protected Action ReportStateChange
    Field Value
    Type Description
    Action

    Properties

    BlendType

    Blend type. This value will be fixed with PlatformProvider.SupportedBlendTypes.

    Declaration
    public BlendType BlendType { get; set; }
    Property Value
    Type Description
    BlendType

    BlendTypeDirectly

    Blend type without fallback. Some blend types aren't supported on specific platforms.

    Declaration
    public BlendType BlendTypeDirectly { get; }
    Property Value
    Type Description
    BlendType

    Methods

    CopyFrom(LayerData)

    Used to copy values from another layer data instance

    Declaration
    public virtual void CopyFrom(LayerData layerData)
    Parameters
    Type Name Description
    LayerData layerData

    Layer data to copy from

    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.

    Validate(CompositionLayer)

    Allows a layer data class to validate values from it's associated composition layer.

    Declaration
    protected virtual bool Validate(CompositionLayer layer)
    Parameters
    Type Name Description
    CompositionLayer layer

    Compositon layer to validate against this layer data.

    Returns
    Type Description
    bool

    True if validation passes, false if validation fails.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)