Struct LayerSorting | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct LayerSorting

    This component tags a node with two additional values that allow sorting by layer and order. The default value for both is 0. The entity you add this component to must have a Transform component.

    Entities with a higher layer value overlay entities with a lower layer value. The order value defines how entities with the same layer value are ordered. As with layers, entities with a higher order value overlay those with a lower order value.

    Layer sorting happens before order sorting, and both happen before axis sorting. Axis sorting only happens when entities share the same layer and order values.

    LayerSorting values are not propagated through the hierarchy.

    Namespace: Unity.Tiny.Core2D
    Syntax
    public struct LayerSorting : IComponentData

    Fields

    id

    Id that maps to UnityEngine.SortingLayer.id

    Declaration
    public int id
    Field Value
    Type Description
    System.Int32

    layer

    First, sort by layer.

    Declaration
    public short layer
    Field Value
    Type Description
    System.Int16

    order

    If layer values are equal, sort by order.

    Declaration
    public short order
    Field Value
    Type Description
    System.Int16
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023