Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GridLine

A single placement value for grid-column-start, grid-column-end, grid-row-start and grid-row-end: auto, an explicit line (an integer \>= 1), or span <n> (n \>= 1).
Read time 1 minuteLast updated 6 days ago

Definition

public readonly struct GridLine : IEquatable<GridLine>

Remarks

The value is sign-encoded into a single blittable int so it mirrors the native field 1:1:
0
= auto,
> 0
= line,
< 0
= span(-value). This mirrors how aspect-ratio uses a sentinel value rather than a separate flag.

Properties

Property

Description

isAutoWhether this value is
auto
.
isLineWhether this value is an explicit line.
isSpanWhether this value is a span.
lineThe 1-based line index when _isLine is true; otherwise 0.
placementWhich kind of placement this value represents.
spanThe span count when _isSpan is true; otherwise 0.

Static Properties

Property

Description

Auto
auto
: the edge is resolved by grid auto-placement.

Methods

Method

Description

ToStringThe USS text form:
auto
,
span <n>
, or the line number.

Static Methods

Method

Description

AtLineAn explicit 1-based grid line.
SpanA span of
count
tracks from the opposite edge.

Operators

Operator

Description

GridLineConverts a positive integer to an explicit line; 0 and negatives throw.