Version: 2021.2
言語: 日本語

Tilemap

class in UnityEngine.Tilemaps

/

継承:GridLayout

マニュアルに切り替える

説明

The Tilemap stores Sprites in a layout marked by a Grid component.

変数

animationFrameRateThe frame rate for all Tile animations in the Tilemap.
cellBoundsReturns the boundaries of the Tilemap in cell size.
colorThe color of the Tilemap 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 Tilemap.
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 Tilemap. 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.
DeleteCellsRemoves cells from within the Tilemap's bounds.
EditorPreviewBoxFillDoes an editor preview of a box fill with the given Tile on the Tilemap. 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 Tilemap starting from the given coordinates.
FloodFillDoes a flood fill with the given Tile to place. on the Tilemap starting from the given coordinates.
GetAnimationFrameRetrieves the current animation frame for a Tile at the given position.
GetAnimationFrameCountRetrieves the number of animation frames for a Tile at the given position.
GetAnimationTimeRetrieves the current running animation time for a Tile at the given position.
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 Tilemap.
GetColorGets the Color of a Tile given the XYZ coordinates of a cell in the Tilemap.
GetEditorPreviewColorGets the Color of an editor preview Tile given the XYZ coordinates of a cell in the Tilemap.
GetEditorPreviewSpriteGets the Sprite used in an editor preview Tile given the XYZ coordinates of a cell in the Tilemap.
GetEditorPreviewTileGets the editor preview Tile at the given XYZ coordinates of a cell in the Tilemap.
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 Tilemap.
GetInstantiatedObjectGets the GameObject instantiated by a Tile given the XYZ coordinates of a cell in the Tilemap.
GetObjectToInstantiateGets the GameObject which will be instantiated by a Tile given the XYZ coordinates of a cell in the Tilemap.
GetSpriteGets the Sprite used in a Tile given the XYZ coordinates of a cell in the Tilemap.
GetTileGets the Tile at the given XYZ coordinates of a cell in the Tilemap.
GetTileFlagsGets the TileFlags of the Tile at the given position.
GetTilesBlockRetrieves an array of Tiles with the given bounds.
GetTilesRangeCountRetrieves the number of Tiles within the given range.
GetTilesRangeNonAllocRetrieves an array of Tiles within the given range.
GetTransformMatrixGets the transform matrix of a Tile given the XYZ coordinates of a cell in the Tilemap.
GetUsedSpritesCountGets the total number of different Sprites used in the Tilemap.
GetUsedSpritesNonAllocFills the given array with the total number of different Sprites used in the Tilemap and returns the number of Sprites filled.
GetUsedTilesCountGets 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.
InsertCellsInserts cells into the Tilemap.
RefreshAllTilesRefreshes all Tiles in the Tilemap. The Tilemap will retrieve the rendering data, animation data and other data for all tiles and update all relevant components.
RefreshTileRefreshes a Tile at the given XYZ coordinates of a cell in the Tilemap.
RemoveTileFlagsRemoves the TileFlags onto the Tile at the given position.
ResizeBoundsResizes Tiles in the Tilemap to bounds defined by origin and size.
SetAnimationFrameSets the current animation frame for a Tile at the given position.
SetAnimationTimeSets the running animation time for a Tile at the given position.
SetColliderTypeSets the Collider type of a Tile given the XYZ coordinates of a cell in the Tilemap.
SetColorSets the color of a Tile given the XYZ coordinates of a cell in the Tilemap.
SetEditorPreviewColorSets the color of an editor preview Tile given the XYZ coordinates of a cell in the Tilemap.
SetEditorPreviewTileSets an editor preview Tile given the XYZ coordinates of a cell in the Tilemap.
SetEditorPreviewTransformMatrixSets the transform matrix of an editor preview Tile given the XYZ coordinates of a cell in the Tilemap.
SetTileSets a Tile at the given XYZ coordinates of a cell in the Tilemap.
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 Tilemap.
SetTilesBlockFills bounds with array of Tiles.
SetTransformMatrixSets the transform matrix of a Tile given the XYZ coordinates of a cell in the Tilemap.
SwapTileSwaps all existing Tiles of changeTile to newTile and refreshes all the swapped Tiles.

Events

tilemapTileChangedCallback when Tiles on a Tilemap have changed.

継承メンバー

変数

enabled有効であれば更新され、無効であれば更新されません。
isActiveAndEnabledReports whether a GameObject and its associated Behaviour is active and enabled.
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 名のメソッドを呼び出します。
CompareTagChecks the GameObject's tag against the defined tag.
GetComponentReturns the component of type if the GameObject has one attached.
GetComponentInChildrenReturns the Component of type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the Component of type in the GameObject or any of its parents.
GetComponents GameObject から type のタイプのコンポーネントを「すべて」取得します。
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children. Works recursively.
GetComponentsInParent GameObject や深さ優先探索を活用して、親子関係にある親オブジェクトから type のタイプのコンポーネントを「すべて」取得します。
SendMessageゲームオブジェクトにアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
SendMessageUpwardsゲームオブジェクトと親(の親、さらに親 ... )にアタッチされているすべての MonoBehaviour にある methodName と名付けたメソッドを呼び出します
TryGetComponentGets the component of the specified type, if it exists.
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.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

Static 関数

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.
FindObjectOfTypeタイプ type から最初に見つけたアクティブのオブジェクトを返します
FindObjectsOfTypeGets a list of all loaded objects of Type type.
Instantiateoriginal のオブジェクトをクローンします

Operator

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