Tilemap

class in UnityEngine.Tilemaps

/

Hereda de:GridLayout

Cambiar al Manual

Descripción

The tile map stores sprites in a layout marked by a Grid component.

Variables

animationFrameRateThe frame rate for all tile animations in the tile map.
cellBoundsReturns the boundaries of the Tilemap in cell size.
colorThe color of the tile map layer.
editorPreviewOriginThe origin of the Tilemap in cell position inclusive of editor preview tiles.
editorPreviewSizeThe size of the Tilemap in cells inclusive of editor preview tiles.
layoutGridGets the Grid associated with this tile map.
localBoundsReturns the boundaries of the Tilemap in local space size.
orientationOrientation of the tiles in the Tilemap.
orientationMatrixOrientation Matrix of the orientation of the tiles in the Tilemap.
originThe origin of the Tilemap in cell position.
sizeThe size of the Tilemap in cells.
tileAnchorGets the anchor point of tiles in the Tilemap.

Funciones Públicas

AddTileFlagsAdds the TileFlags onto the Tile at the given position.
BoxFillDoes a box fill with the given tile on the tile map. Starts from given coordinates and fills the limits from start to end (inclusive).
ClearAllEditorPreviewTilesClears all editor preview tiles that are placed in the Tilemap.
ClearAllTilesClears all tiles that are placed in the Tilemap.
CompressBoundsCompresses the origin and size of the Tilemap to bounds where tiles exist.
ContainsTileReturns true if the Tilemap contains the given tile. Returns false if not.
EditorPreviewBoxFillDoes an editor preview of a box fill with the given tile on the tile map. Starts from given coordinates and fills the limits from start to end (inclusive).
EditorPreviewFloodFillDoes an editor preview of a flood fill with the given tile to place. on the tile map starting from the given coordinates.
FloodFillDoes a flood fill with the given tile to place. on the tile map starting from the given coordinates.
GetCellCenterLocalGet the logical center coordinate of a grid cell in local space.
GetCellCenterWorldGet the logical center coordinate of a grid cell in world space.
GetColliderTypeGets the collider type of a tile given the XYZ coordinates of a cell in the tile map.
GetColorGets the color of a tile given the XYZ coordinates of a cell in the tile map.
GetEditorPreviewColorGets the Color of an editor preview tile given the XYZ coordinates of a cell in the tile map.
GetEditorPreviewSpriteGets the Sprite used in an editor preview tile given the XYZ coordinates of a cell in the tile map.
GetEditorPreviewTileGets the editor preview tile at the given XYZ coordinates of a cell in the tile map.
GetEditorPreviewTileFlagsGets the TileFlags of the editor preview Tile at the given position.
GetEditorPreviewTransformMatrixGets the transform matrix of an editor preview tile given the XYZ coordinates of a cell in the tile map.
GetInstantiatedObjectGets the GameObject instantiated by a tile given the XYZ coordinates of a cell in the tile map.
GetSpriteGets the Sprite used in a tile given the XYZ coordinates of a cell in the tile map.
GetTileGets the tile at the given XYZ coordinates of a cell in the tile map.
GetTileFlagsGets the TileFlags of the Tile at the given position.
GetTilesBlockRetrieves an array of tiles with the given bounds.
GetTransformMatrixGets the transform matrix of a tile given the XYZ coordinates of a cell in the tile map.
GetUsedTilesCountGet the total number of different tiles used in the Tilemap.
GetUsedTilesNonAllocFills the given array with the total number of different tiles used in the Tilemap and returns the number of tiles filled.
HasEditorPreviewTileReturns whether there is an editor preview tile at the position.
HasTileReturns whether there is a tile at the position.
RefreshAllTilesRefreshes all tiles in the tile map. The tile map will retrieve the rendering data, animation data and other data for all tiles and update all relevant components.
RefreshTileRefreshes a tile at the given coordinates of a cell in the tile map.
RemoveTileFlagsRemoves the TileFlags onto the Tile at the given position.
ResizeBoundsResizes tiles in the Tilemap to bounds defined by origin and size.
SetColliderTypeSets the collider type of a tile given the XYZ coordinates of a cell in the tile map.
SetColorSets the color of a tile given the XYZ coordinates of a cell in the tile map.
SetEditorPreviewColorSets the color of an editor preview tile given the XYZ coordinates of a cell in the tile map.
SetEditorPreviewTileSets an editor preview tile given the XYZ coordinates of a cell in the tile map.
SetEditorPreviewTransformMatrixSets the transform matrix of an editor preview tile given the XYZ coordinates of a cell in the tile map.
SetTileSets a tile at the given XYZ coordinates of a cell in the tile map.
SetTileFlagsSets the TileFlags onto the Tile at the given position.
SetTilesSets an array of tiles at the given XYZ coordinates of the corresponding cells in the tile map.
SetTilesBlockFills bounds with array of tiles.
SetTransformMatrixSets the transform matrix of a tile given the XYZ coordinates of a cell in the tile map.
SwapTileSwaps all existing tiles of changeTile to newTile and refreshes all the swapped tiles.

Miembros heredados

Variables

enabledEnabled Behaviours are Updated, disabled Behaviours are not.
isActiveAndEnabledHas the Behaviour had active and enabled called?
gameObjectEl game object que tiene este componente adjunto. Un componente siempre está adjunto a un game object.
tagEl tag de este game object.
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?
nameEl nombre del objeto.

Funciones Públicas

BroadcastMessageLlama al método denominado methodName de todos los MonoBehaviour en este game objecto en cualquiera de sus hijos.
CompareTag¿Este game object está etiquetado con tag?
GetComponentDevuelve un componente de tipo type si el game object tiene a alguno adjuntado, o null si no lo tiene.
GetComponentInChildrenRetorna el componente de tipo type en el GameObject o cualquiera de sus hijos utilizando depth first search (busqueda de profundidad).
GetComponentInParentRetorna el componente de tipo type en el GameObject o cualquiera de sus padres.
GetComponentsRetorna todos los componentes de tipo type en el GameObject.
GetComponentsInChildrenRetorna todos los componentes de tipo type en el GameObject o cualquiera de sus hijo.
GetComponentsInParentRetorna todos los componentes de tipo type en el GameObject o cualquiera de sus padres.
SendMessageLlama al método denominado methodName en cada MonoBehaviour de este game object.
SendMessageUpwardsLlama al método denominado methodName en todos los MonoBehaviour de este juego y en todos los ancestros del behaviour.
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.
GetInstanceIDDevuelve el id de la instancia del objeto.
ToStringReturns the name of the object.

Funciones Estáticas

DestroyRemoves a GameObject, component or 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.
FindObjectOfTypeDevuelve el primer objeto activo cargado de tipo type.
FindObjectsOfTypeDevuelve una lista de todos los objetos activos cargados de tipo type.
InstantiateClona el objeto original y devuelve el clon.

Operadores

bool¿Existe el objeto?
operator !=Compare si dos objetos se refieren a un objeto diferente.
operator ==Compara dos referencias de objeto para ver si se refieren al mismo objeto.
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961