GridLayout
An abstract class that defines a grid layout.
Read time 7 minutesLast updated 3 days ago
Definition
- Type: Class
- Namespace: UnityEngine
- Assembly: UnityEngine.GridModule
- Inherits from: Behaviour
[RequireComponent(typeof(Transform))]public class GridLayout : Behaviour
Remarks
Additional Resources: Grid.
Properties
Property | Description |
|---|---|
| cellGap | The size of the gap between each cell in the layout. |
| cellLayout | Cell shape and packing that this layout uses when converting between cell and local space. |
| cellSize | The size of each cell in the layout. |
| cellSwizzle | Cell swizzle order that this layout applies when converting cell positions to local space. |
Methods
Method | Description |
|---|---|
| CellToLocal | Converts a cell position to local position space. |
| CellToLocalInterpolated | Converts an interpolated cell position in floats to local position space. |
| CellToWorld | Converts a cell position to world position space. |
| GetBoundsLocal | Returns the local bounds for the groups of cells at the location. |
| GetLayoutCellCenter | Get the default center coordinate of a cell for the set layout of the Grid. |
| LocalToCell | Converts a local position to cell position. |
| LocalToCellInterpolated | Converts a local position to cell position. |
| LocalToWorld | Converts a local position to world position. |
| WorldToCell | Converts a world position to cell position. |
| WorldToLocal | Converts a world position to local position. |
Enums
Enum | Description |
|---|---|
| GridLayout.CellLayout | The layout of the GridLayout. |
| GridLayout.CellSwizzle | Swizzles cell positions to other positions. |
Inheritance
Operators
Operator | Description |
|---|---|
| operator == | Compares two object references to see if they refer to the same object. |
| bool | Determines whether the object exists. |
| operator != | Compares if two objects refer to a different object. |