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 |