Grid

class in UnityEngine

/

Inherits from:GridLayout

Switch to Manual

Description

Grid is the base class for plotting a layout of uniformly spaced points and lines.

The Grid component stores dimensional data of the layout of the grid and provides helper functions to retrieve information about the grid, such as the conversion between the cell location and local space location of items within the grid.

The layout of the Grid component is in the XY plane with the origin of the grid always beginning at (0, 0) and the X and Y coordinates of the grid only as positive values.

Implements the interface GridLayout.

Variables

cellGapThe size of the gap between each cell in the Grid.
cellLayoutThe layout of the cells in the Grid.
cellSizeThe size of each cell in the Grid.
cellSwizzleThe cell swizzle for the Grid.

Public Functions

GetCellCenterLocalGet the logical center coordinate of a grid cell in local space.
GetCellCenterWorldGet the logical center coordinate of a grid cell in world space.

Static Functions

InverseSwizzleDoes the inverse swizzle of the given position for given swizzle order.
SwizzleSwizzles the given position with the given swizzle order.

Inherited members

Variables

enabledВключенное Поведение обновляется, выключенное Поведение не обновляется.
isActiveAndEnabledHas the Behaviour had active and enabled called?
gameObjectИгровой объект к которому прикреплён данный компонент. Компонент всегда прикреплён к игровому объекту.
tagТег данного игрового объекта.
transformThe Transform attached to this GameObject.
cellGapThe size of the gap between each cell in the layout.
cellLayoutThe layout of the cells.
cellSizeThe size of each cell in the layout.
cellSwizzleThe cell swizzle for the layout.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public Functions

BroadcastMessageВызывает метод названный methodName на каждом MonoBehaviour этого game object-а или любого из его потомков.
CompareTagПомечен ли данный игровой объект тегом tag?
GetComponentВозвращает компонент типа type, если он прикреплен к игровому объекту и null, если не прикреплен.
GetComponentInChildrenВозвращает компонент типа type в GameObject или некоторого его потомка через поиск в глубину.
GetComponentInParentВозвращает все компоненты типа type из GameObject'а или из любого его родителя.
GetComponentsВозвращает все компоненты типа type в GameObject.
GetComponentsInChildrenВозвращает все компоненты типа type в GameObject или любому из его потомков.
GetComponentsInParentВозвращает все компоненты типа type в GameObject или любому из его родителей.
SendMessageВызывает метод с названием methodName в каждом MonoBehaviour в этом игровом объекте.
SendMessageUpwardsВызывает метод с именем methodName в каждом MonoBehaviour в этом игровом объекте и в каждом предке поведения.
CellToLocalConverts a cell position to local position space.
CellToLocalInterpolatedConverts an interpolated cell position in floats to local position space.
CellToWorldConverts a cell position to world position space.
GetBoundsLocalReturns the local bounds for a cell at the location.
GetLayoutCellCenterGet the default center coordinate of a cell for the set layout of the Grid.
LocalToCellConverts a local position to cell position.
LocalToCellInterpolatedConverts a local position to cell position.
LocalToWorldConverts a local position to world position.
WorldToCellConverts a world position to cell position.
WorldToLocalConverts a world position to local position.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the GameObject.

Static Functions

DestroyУдаляет GameObject, Component или Asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

Operators

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.