Nostalgia
2.1.5
|
Components of 2D tile map. More...
Classes | |
class | CellResult |
Class that will contain the result of Map.FindCell (). More... | |
Public Types | |
enum | HorizontalPivot { Left, Center, Right } |
Specifies the pivot in the horizontal direction. More... | |
enum | VerticalPivot { Top, Center, Bottom } |
Specifies the pivot in the vertical direction. More... | |
Public Member Functions | |
delegate void | OnRepainted () |
Callback delegate when repainted More... | |
Cell | GetCell (int index) |
Get the Cell from the index . More... | |
Chunk | GetChunk (int index) |
Get the chunk from the index . More... | |
MapCollider | GetMapCollider (int index) |
Get the MapCollider from the index . More... | |
Stamp | GetStamp (int index) |
Get the chunk from the index . More... | |
int | IndexOfStamp (Stamp stamp) |
Get the index from the Stamp. More... | |
Cell | GetCell (Point2 pos) |
Gets the Cell. More... | |
Cell | GetCellFromWorldPos (Vector3 worldPos) |
Gets the cell from world position. More... | |
Cell | GetCellFromCollider (Collider2D collider) |
Gets the Cell from collider. More... | |
Tile | GetTile (Point2 pos) |
Gets the tile. More... | |
Vector3 | MapPointToLocalPoint (Point2 pos) |
Maps the point to local point. More... | |
Vector3 | MapPointToWorldPoint (Point2 pos) |
Maps the point to world point. More... | |
Point2 | LocalPointToMapPoint (Vector3 localPos) |
Locals the point to map point. More... | |
Point2 | WorldPointToMapPoint (Vector3 worldPos) |
Worlds the point to map point. More... | |
bool | RayToPoint (Ray ray, out Point2 pos) |
Raies to point. More... | |
bool | Raycast (Ray ray, ref Vector2 localPos) |
Raies to local point. More... | |
void | Resize (int width, int height, HorizontalPivot horizontalPivot, VerticalPivot verticalPivot) |
Resize. More... | |
void | InsertCell (Point2 pos, Point2 size) |
To insert cells. More... | |
void | RemoveCell (Point2 pos, Point2 size) |
To remove cells More... | |
bool | PutTile (Point2 pos, Tile tile, int partsID, Point2 tilePos, bool autoTiling, bool changeParts, bool isCreateCellObject) |
Puts the tile. More... | |
bool | FillTile (Point2 pos, int width, int height, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
Fills the tile. More... | |
Async | FillTileAsync (Point2 pos, int width, int height, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
Fills the tile (Async). More... | |
Stamp | CreateStamp (Point2 pos, int width, int height) |
To create a stamp More... | |
void | RemoveStamp (Stamp stamp) |
To remove the stamp More... | |
bool | PutStamp (Point2 pos, Stamp stamp, bool autoTiling, bool isCreateCellObject) |
Fills the tile from stamp. More... | |
bool | UpdateAutoTiles (HashSet< Point2 > points, bool aroundOnly=false) |
Update process of the Cell by auto tile More... | |
bool | BucketTile (Point2 pos, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
Buckets the tile. More... | |
Async | BucketTileAsync (Point2 pos, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
Buckets the tile (Async). More... | |
bool | RemoveTile (Cell cell, bool autoTiling) |
Removes the tile. More... | |
bool | RemoveTile (Point2 pos, bool autoTiling) |
Removes the tile. More... | |
bool | RemoveRectangleTile (Point2 pos, int width, int height, bool autoTiling) |
Tile remove of a rectangle specified. More... | |
Async | RemoveRectangleTileAsync (Point2 pos, int width, int height, bool autoTiling) |
Tile remove of a rectangle specified (Async). More... | |
bool | RemoveBucketTile (Point2 pos, bool autoTiling) |
Tile deletion in bucket form. More... | |
Async | RemoveBucketTileAsync (Point2 pos, bool autoTiling) |
Tile deletion in bucket form(Async). More... | |
bool | ColorBrush (Vector2 center, float radius, Color color, bool halftile) |
Colors the brush. More... | |
bool | ColorBrushRectangle (Vector2 pos, float width, float height, Color color, bool halftile) |
Paint a vertex color rectangle specified. More... | |
void | AllClear () |
Alls the clear. More... | |
Async | AllClearAsync () |
bool | UpdateCollider (Cell cell) |
To update the status of the Collider of the Cell. More... | |
MapCollider | GetMapCollider (PolygonCollider2D collider) |
Get MapCollider from PolygonCollider2D. More... | |
MapCollider | GetMapCollider (Cell cell) |
Get MapCollider from Cell. More... | |
void | UpdateMapCollider () |
Update MapColliders More... | |
bool | Refresh () |
Refresh this instance. More... | |
Async | RefreshAsync () |
Rebuild the Cell asynchronously. More... | |
void | SetDirty (bool repaint) |
You set up to rebuild the mesh. More... | |
void | Repaint () |
Repaint More... | |
void | Copy (Map source) |
Copy the Map. More... | |
void | DestroySubComponents () |
Destroies the sub components. More... | |
Static Public Member Functions | |
static Map | GetMap (int index) |
Get the Map from the index . More... | |
static CellResult | FindCell (Vector3 worldPos) |
Finds the Cell from the world position. More... | |
static CellResult[] | FindCells (Vector3 worldPos) |
Find Cell everything in the world coordinates to the specified. More... | |
static Cell | FindCell (Collider2D collider) |
Find Cell from Collider 2D. More... | |
Properties | |
int | width [get] |
Gets the width. More... | |
int | height [get] |
Gets the height. More... | |
TileSet | tileSet [get, set] |
Gets / Sets the tile set. More... | |
bool | edgeCombine [get, set] |
Whether or not to combine auto tiles with map edges More... | |
bool | isCanvas [get] |
Whether to render to a Canvas. More... | |
int | cellCount [get] |
Get the number of Cells. More... | |
int | chunkCount [get] |
Get the number of chunks. More... | |
int | mapColliderCount [get] |
Get the number of MapColliders. More... | |
int | stampCount [get] |
Get the number of stamps. More... | |
Color | color [get, set] |
Gets or sets the material color. More... | |
int | sortingLayerID [get, set] |
Gets or sets the sortingLayerID. More... | |
int | sortingOrder [get, set] |
Gets or sets the sortingOrder. More... | |
static int | mapCount [get] |
Get the number of Maps. More... | |
Material | material [get] |
Gets the material. More... | |
Events | |
OnRepainted | onRepainted |
Callback event when repainted More... | |
Components of 2D tile map.
And it may be attached to a GameObject.
|
strong |
Specifies the pivot in the horizontal direction.
Use a Resize().
Enumerator | |
---|---|
Left |
The left. |
Center |
The center. |
Right |
The right. |
|
strong |
Specifies the pivot in the vertical direction.
Use a Resize().
Enumerator | |
---|---|
Top |
The top. |
Center |
The center. |
Bottom |
The bottom. |
void AllClear | ( | ) |
Alls the clear.
Async AllClearAsync | ( | ) |
Buckets the tile.
true
, if tile was bucketed, false
otherwise. pos | Position. |
tile | Tile. |
partsID | Parts ID. |
autoTiling | If set to true auto tiling. |
isCreateCellObject | Whether you want to create a CellObject |
Async BucketTileAsync | ( | Point2 | pos, |
Tile | tile, | ||
int | partsID, | ||
bool | autoTiling, | ||
bool | isCreateCellObject | ||
) |
Buckets the tile (Async).
pos | Position. |
tile | Tile. |
partsID | Parts ID. |
autoTiling | If set to true auto tiling. |
isCreateCellObject | Whether you want to create a CellObject |
bool ColorBrush | ( | Vector2 | center, |
float | radius, | ||
Color | color, | ||
bool | halftile | ||
) |
Colors the brush.
true
, Changed. false
otherwise. center | Center. |
radius | Radius. |
color | Color. |
halftile | Fill half per tile. |
bool ColorBrushRectangle | ( | Vector2 | pos, |
float | width, | ||
float | height, | ||
Color | color, | ||
bool | halftile | ||
) |
Paint a vertex color rectangle specified.
true
, Changed. false
otherwise. pos | Position. |
width | Width. |
height | Height. |
color | Color. |
halftile | Fill half per tile. |
void DestroySubComponents | ( | ) |
Destroies the sub components.
Usually, you do not need to call.
bool FillTile | ( | Point2 | pos, |
int | width, | ||
int | height, | ||
Tile | tile, | ||
int | partsID, | ||
bool | autoTiling, | ||
bool | isCreateCellObject | ||
) |
Fills the tile.
true
, if tile was filled, false
otherwise. pos | Position. |
width | Width. |
height | Height. |
tile | Tile. |
partsID | Parts ID. |
autoTiling | If set to true auto tiling. |
isCreateCellObject | Whether you want to create a CellObject |
Async FillTileAsync | ( | Point2 | pos, |
int | width, | ||
int | height, | ||
Tile | tile, | ||
int | partsID, | ||
bool | autoTiling, | ||
bool | isCreateCellObject | ||
) |
Fills the tile (Async).
pos | Position. |
width | Width. |
height | Height. |
tile | Tile. |
partsID | Parts ID. |
autoTiling | If set to true auto tiling. |
isCreateCellObject | Whether you want to create a CellObject |
|
static |
Finds the Cell from the world position.
worldPos | World position. |
|
static |
|
static |
Find Cell everything in the world coordinates to the specified.
worldPos | World position. |
Cell GetCellFromCollider | ( | Collider2D | collider | ) |
Cell GetCellFromWorldPos | ( | Vector3 | worldPos | ) |
Gets the cell from world position.
worldPos | World position. |
Chunk GetChunk | ( | int | index | ) |
Get the chunk from the index .
index | index |
MapCollider GetMapCollider | ( | int | index | ) |
MapCollider GetMapCollider | ( | PolygonCollider2D | collider | ) |
Get MapCollider from PolygonCollider2D.
collider | PolygonCollider2D |
MapCollider GetMapCollider | ( | Cell | cell | ) |
Get MapCollider from Cell.
cell | Cell |
Stamp GetStamp | ( | int | index | ) |
Get the chunk from the index .
index | index |
Gets the tile.
pos | Position. |
Point2 LocalPointToMapPoint | ( | Vector3 | localPos | ) |
Locals the point to map point.
localPos | Local position. |
Vector3 MapPointToLocalPoint | ( | Point2 | pos | ) |
Maps the point to local point.
pos | Position. |
Vector3 MapPointToWorldPoint | ( | Point2 | pos | ) |
Maps the point to world point.
pos | Position. |
delegate void OnRepainted | ( | ) |
Callback delegate when repainted
Fills the tile from stamp.
true
, if tile was filled, false
otherwise. pos | Position. |
stamp | Stamp. |
autoTiling | If set to true auto tiling. |
isCreateCellObject | Whether you want to create a CellObject |
bool PutTile | ( | Point2 | pos, |
Tile | tile, | ||
int | partsID, | ||
Point2 | tilePos, | ||
bool | autoTiling, | ||
bool | changeParts, | ||
bool | isCreateCellObject | ||
) |
Puts the tile.
true
, if tile was put, false
otherwise. pos | Position. |
tile | Tile. |
partsID | Parts ID. |
tilePos | Tile Position |
autoTiling | If set to true auto tiling. |
changeParts | If set to true change parts. |
isCreateCellObject | Whether you want to create a CellObject |
bool Raycast | ( | Ray | ray, |
ref Vector2 | localPos | ||
) |
Raies to local point.
ray | Ray. |
localPos | Local position. |
bool RayToPoint | ( | Ray | ray, |
out Point2 | pos | ||
) |
Raies to point.
true
, if to point was rayed, false
otherwise. ray | Ray. |
pos | Position. |
Async RefreshAsync | ( | ) |
bool RemoveBucketTile | ( | Point2 | pos, |
bool | autoTiling | ||
) |
Tile deletion in bucket form.
true
, if tile was removed, false
otherwise. pos | Position. |
autoTiling | If set to true auto tiling. |
bool RemoveRectangleTile | ( | Point2 | pos, |
int | width, | ||
int | height, | ||
bool | autoTiling | ||
) |
Tile remove of a rectangle specified.
true
, if tile was removed, false
otherwise. pos | Position. |
width | Width. |
height | Height. |
autoTiling | If set to true auto tiling. |
bool RemoveTile | ( | Cell | cell, |
bool | autoTiling | ||
) |
Removes the tile.
true
, if tile was removed, false
otherwise. cell | Cell. |
autoTiling | If set to true auto tiling. |
bool RemoveTile | ( | Point2 | pos, |
bool | autoTiling | ||
) |
Removes the tile.
true
, if tile was removed, false
otherwise. pos | Position. |
autoTiling | If set to true auto tiling. |
void Repaint | ( | ) |
Repaint
void Resize | ( | int | width, |
int | height, | ||
HorizontalPivot | horizontalPivot, | ||
VerticalPivot | verticalPivot | ||
) |
Resize.
width | Width. |
height | Height. |
horizontalPivot | Horizontal pivot. |
verticalPivot | Vertical pivot. |
void SetDirty | ( | bool | repaint | ) |
You set up to rebuild the mesh.
Please call when you directly modify the Cell.
repaint | Whether or not to repaint |
bool UpdateAutoTiles | ( | HashSet< Point2 > | points, |
bool | aroundOnly = false |
||
) |
Update process of the Cell by auto tile
points | Coordinates to be updated |
aroundOnly | Whether you want to update only the peripheral |
bool UpdateCollider | ( | Cell | cell | ) |
void UpdateMapCollider | ( | ) |
Update MapColliders
Point2 WorldPointToMapPoint | ( | Vector3 | worldPos | ) |
Worlds the point to map point.
worldPos | World position. |
|
get |
Get the number of Cells.
|
get |
Get the number of chunks.
|
getset |
Gets or sets the material color.
|
getset |
Whether or not to combine auto tiles with map edges
|
get |
Gets the height.
The height.
|
get |
Whether to render to a Canvas.
When the Map game object has RectTransform, it is in Canvas mode.
|
get |
Get the number of MapColliders.
|
staticget |
Get the number of Maps.
|
get |
Gets the material.
|
getset |
Gets or sets the sortingLayerID.
|
getset |
Gets or sets the sortingOrder.
|
get |
Get the number of stamps.
|
getset |
Gets / Sets the tile set.
The tile set.
|
get |
Gets the width.
The width.
OnRepainted onRepainted |
Callback event when repainted