Version: 2018.2

Tilemap

class in UnityEngine.Tilemaps

/

継承:GridLayout

マニュアルに切り替える

説明

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

変数

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.

Public 関数

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.

継承メンバー

変数

enabled有効であれば更新され、無効であれば更新されません。
isActiveAndEnabledBehaviour が有効かどうか
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?
nameオブジェクト名

Public 関数

BroadcastMessageゲームオブジェクトまたは子オブジェクトにあるすべての MonoBehaviour を継承したクラスにある methodName 名のメソッドを呼び出します。
CompareTagこのゲームオブジェクトは tag とタグ付けされているかどうか
GetComponentゲームオブジェクトに type がアタッチされている場合は type のタイプを使用してコンポーネントを返します。ない場合は null です
GetComponentInChildren GameObject や深さ優先探索を活用して、親子関係にある子オブジェクトから type のタイプのコンポーネントを取得します。
GetComponentInParent GameObject や深さ優先探索を活用して、親子関係にある親オブジェクトから type のタイプのコンポーネントを取得します。
GetComponents GameObject から type のタイプのコンポーネントを「すべて」取得します。
GetComponentsInChildren GameObject や深さ優先探索を活用して、親子関係にある子オブジェクトから type のタイプのコンポーネントを「すべて」取得します。
GetComponentsInParent GameObject や深さ優先探索を活用して、親子関係にある親オブジェクトから type のタイプのコンポーネントを「すべて」取得します。
SendMessageゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
SendMessageUpwardsゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
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.
GetInstanceIDオブジェクトのインスタンス ID を返します
ToStringReturns the name of the GameObject.

Static 関数

Destroyゲームオブジェクトやコンポーネント、アセットを削除します
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsOfTypeタイプから見つけたすべてのアクティブのオブジェクト配列を返します
Instantiateoriginal のオブジェクトをクローンします

Operator

boolオブジェクトが存在するかどうか
operator !=二つのオブジェクトが異なるオブジェクトを参照しているか比較します
operator ==2つのオブジェクト参照が同じオブジェクトを参照しているか比較します。
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961