|
Nostalgia
2.1.5
|
2Dタイルマップのコンポーネント。 More...
Classes | |
| class | CellResult |
| Map.FindCell()の結果が格納されるクラス。 More... | |
Public Types | |
| enum | HorizontalPivot { Left, Center, Right } |
| 横方向のピボットを指定。 More... | |
| enum | VerticalPivot { Top, Center, Bottom } |
| 縦方向のピボットを指定。 More... | |
Public Member Functions | |
| delegate void | OnRepainted () |
| 再描画時のコールバックdelegate More... | |
| Cell | GetCell (int index) |
| インデックスからCellを取得 More... | |
| Chunk | GetChunk (int index) |
| インデックスからチャンクを取得 More... | |
| MapCollider | GetMapCollider (int index) |
| インデックスからMapColliderを取得 More... | |
| Stamp | GetStamp (int index) |
| インデックスからStampを取得 More... | |
| int | IndexOfStamp (Stamp stamp) |
| Stampからインデックスを取得 More... | |
| Cell | GetCell (Point2 pos) |
| Cellを取得。 More... | |
| Cell | GetCellFromWorldPos (Vector3 worldPos) |
| ワールド座標からCellを取得。 More... | |
| Cell | GetCellFromCollider (Collider2D collider) |
| ColliderからCellを取得する。 More... | |
| Tile | GetTile (Point2 pos) |
| Tileを取得。 More... | |
| Vector3 | MapPointToLocalPoint (Point2 pos) |
| Map座標からローカル座標に変換。 More... | |
| Vector3 | MapPointToWorldPoint (Point2 pos) |
| Map座標からワールド座標に変換。 More... | |
| Point2 | LocalPointToMapPoint (Vector3 localPos) |
| ローカル座標からMap座標に変換。 More... | |
| Point2 | WorldPointToMapPoint (Vector3 worldPos) |
| ワールド座標からMap座標に変換。 More... | |
| bool | RayToPoint (Ray ray, out Point2 pos) |
| レイからMap座標に変換。 More... | |
| bool | Raycast (Ray ray, ref Vector2 localPos) |
| レイからローカル座標を取得。 More... | |
| void | Resize (int width, int height, HorizontalPivot horizontalPivot, VerticalPivot verticalPivot) |
| サイズ変更。 More... | |
| void | InsertCell (Point2 pos, Point2 size) |
| Cellを挿入する More... | |
| void | RemoveCell (Point2 pos, Point2 size) |
| Cellを削除する More... | |
| bool | PutTile (Point2 pos, Tile tile, int partsID, Point2 tilePos, bool autoTiling, bool changeParts, bool isCreateCellObject) |
| Tile配置 More... | |
| bool | FillTile (Point2 pos, int width, int height, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
| Tileを塗る More... | |
| Async | FillTileAsync (Point2 pos, int width, int height, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
| Tileを塗る(非同期) More... | |
| Stamp | CreateStamp (Point2 pos, int width, int height) |
| Stampを作成する More... | |
| void | RemoveStamp (Stamp stamp) |
| Stampを削除する More... | |
| bool | PutStamp (Point2 pos, Stamp stamp, bool autoTiling, bool isCreateCellObject) |
| StampでTileを塗る More... | |
| bool | UpdateAutoTiles (HashSet< Point2 > points, bool aroundOnly=false) |
| オートタイルによるCellの更新処理 More... | |
| bool | BucketTile (Point2 pos, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
| Tileを塗りつぶし More... | |
| Async | BucketTileAsync (Point2 pos, Tile tile, int partsID, bool autoTiling, bool isCreateCellObject) |
| Tileを塗りつぶし(非同期) More... | |
| bool | RemoveTile (Cell cell, bool autoTiling) |
| Tile削除。 More... | |
| bool | RemoveTile (Point2 pos, bool autoTiling) |
| Tile削除。 More... | |
| bool | RemoveRectangleTile (Point2 pos, int width, int height, bool autoTiling) |
| 矩形指定でのTile削除。 More... | |
| Async | RemoveRectangleTileAsync (Point2 pos, int width, int height, bool autoTiling) |
| 矩形指定でのTile削除(非同期)。 More... | |
| bool | RemoveBucketTile (Point2 pos, bool autoTiling) |
| バケツ形式でのTile削除。 More... | |
| Async | RemoveBucketTileAsync (Point2 pos, bool autoTiling) |
| バケツ形式でのTile削除(非同期) More... | |
| bool | ColorBrush (Vector2 center, float radius, Color color, bool halftile) |
| カラーブラシで頂点を塗る。 More... | |
| bool | ColorBrushRectangle (Vector2 pos, float width, float height, Color color, bool halftile) |
| 矩形指定で頂点カラーを塗る。 More... | |
| void | AllClear () |
| 全てクリア More... | |
| Async | AllClearAsync () |
| bool | UpdateCollider (Cell cell) |
| CellのColliderの状態を更新する。 More... | |
| MapCollider | GetMapCollider (PolygonCollider2D collider) |
| PolygonCollider2DからMapColliderを取得する。 More... | |
| MapCollider | GetMapCollider (Cell cell) |
| CellからMapColliderを取得する。 More... | |
| void | UpdateMapCollider () |
| MapColliderを更新する。 More... | |
| bool | Refresh () |
| Cellを再構築します。 TileSetを更新した場合などに呼び出してください。 More... | |
| Async | RefreshAsync () |
| 非同期でCellを再構築します。 TileSetを更新した場合などに呼び出してください。 More... | |
| void | SetDirty (bool repaint) |
| メッシュを再構築するように設定します。 Cellを直接変更した際に呼び出してください。 More... | |
| void | Repaint () |
| 再描画する More... | |
| void | Copy (Map source) |
| Mapをコピーします。 More... | |
| void | DestroySubComponents () |
| サブコンポーネントを削除します。 通常、呼び出す必要はありません。 More... | |
Static Public Member Functions | |
| static Map | GetMap (int index) |
| インデックスからMapを取得 More... | |
| static CellResult | FindCell (Vector3 worldPos) |
| ワールド座標からCellを探す。 More... | |
| static CellResult[] | FindCells (Vector3 worldPos) |
| 指定したワールド座標上にある全てのCellを探す。 More... | |
| static Cell | FindCell (Collider2D collider) |
| Collider2DからCellを取得。 More... | |
Properties | |
| int | width [get] |
| 横幅を取得。 More... | |
| int | height [get] |
| 縦幅を取得。 More... | |
| TileSet | tileSet [get, set] |
| TileSetを取得/設定する。 More... | |
| bool | edgeCombine [get, set] |
| マップ端とオートタイルを結合するかどうか More... | |
| bool | isCanvas [get] |
| Canvasにレンダリングするかどうか。 MapゲームオブジェクトがRectTransformを持つ場合にCanvasモードとなる。 More... | |
| int | cellCount [get] |
| Cellの数を取得 More... | |
| int | chunkCount [get] |
| チャンクの数を取得 More... | |
| int | mapColliderCount [get] |
| MapColliderの数を取得 More... | |
| int | stampCount [get] |
| Stampの数を取得 More... | |
| Color | color [get, set] |
| マテリアルカラーの取得/設定。 More... | |
| int | sortingLayerID [get, set] |
| SortingLayerIDの取得/設定。 More... | |
| int | sortingOrder [get, set] |
| sortingOrderの取得/設定。 More... | |
| static int | mapCount [get] |
| Mapの数を取得 More... | |
| Material | material [get] |
| マテリアルを取得 More... | |
Events | |
| OnRepainted | onRepainted |
| 再描画時のコールバックイベント More... | |
2Dタイルマップのコンポーネント。
GameObjectにアタッチして使用する。
|
strong |
|
strong |
| void AllClear | ( | ) |
全てクリア
| Async AllClearAsync | ( | ) |
Tileを塗りつぶし
true, 塗りつぶしできた。 false それ以外。 | pos | 座標 |
| tile | Tile |
| partsID | パーツID |
| autoTiling | trueを設定した場合オートタイル。 |
| isCreateCellObject | CellObjectを作成するかどうか |
| Async BucketTileAsync | ( | Point2 | pos, |
| Tile | tile, | ||
| int | partsID, | ||
| bool | autoTiling, | ||
| bool | isCreateCellObject | ||
| ) |
Tileを塗りつぶし(非同期)
| pos | 座標 |
| tile | Tile |
| partsID | パーツID |
| autoTiling | trueを設定した場合オートタイル。 |
| isCreateCellObject | CellObjectを作成するかどうか |
| bool ColorBrush | ( | Vector2 | center, |
| float | radius, | ||
| Color | color, | ||
| bool | halftile | ||
| ) |
カラーブラシで頂点を塗る。
true, 変更した false それ以外 | center | 中心座標 |
| radius | 半径 |
| color | 色 |
| halftile | 半タイルごとに塗りつぶす。 |
| bool ColorBrushRectangle | ( | Vector2 | pos, |
| float | width, | ||
| float | height, | ||
| Color | color, | ||
| bool | halftile | ||
| ) |
矩形指定で頂点カラーを塗る。
true, 変更した。 false それ以外 | pos | 座標 |
| width | 横幅 |
| height | 縦幅 |
| color | 色 |
| halftile | 半タイルごとに塗りつぶす。 |
| void Copy | ( | Map | source | ) |
Mapをコピーします。
| source | コピー元のMap |
Stampを作成する
| pos | 位置 |
| width | 幅 |
| height | 高さ |
| void DestroySubComponents | ( | ) |
サブコンポーネントを削除します。 通常、呼び出す必要はありません。
| bool FillTile | ( | Point2 | pos, |
| int | width, | ||
| int | height, | ||
| Tile | tile, | ||
| int | partsID, | ||
| bool | autoTiling, | ||
| bool | isCreateCellObject | ||
| ) |
Tileを塗る
true, 塗ることができた。 false それ以外 | pos | 座標 |
| width | 横幅 |
| height | 縦幅 |
| tile | Tile |
| partsID | パーツID |
| autoTiling | trueを設定した場合オートタイル。 |
| isCreateCellObject | CellObjectを作成するかどうか |
| Async FillTileAsync | ( | Point2 | pos, |
| int | width, | ||
| int | height, | ||
| Tile | tile, | ||
| int | partsID, | ||
| bool | autoTiling, | ||
| bool | isCreateCellObject | ||
| ) |
Tileを塗る(非同期)
| pos | 座標 |
| width | 横幅 |
| height | 縦幅 |
| tile | Tile |
| partsID | パーツID |
| autoTiling | trueを設定した場合オートタイル。 |
| isCreateCellObject | CellObjectを作成するかどうか |
|
static |
ワールド座標からCellを探す。
| worldPos | ワールド座標。 |
|
static |
Collider2DからCellを取得。
| collider | Cellを取得するCollider2D |
|
static |
指定したワールド座標上にある全てのCellを探す。
| worldPos | ワールド座標。 |
| Cell GetCellFromCollider | ( | Collider2D | collider | ) |
ColliderからCellを取得する。
| collider | Collider. |
| Cell GetCellFromWorldPos | ( | Vector3 | worldPos | ) |
ワールド座標からCellを取得。
| worldPos | ワールド座標。 |
| Chunk GetChunk | ( | int | index | ) |
インデックスからチャンクを取得
| index | インデックス |
| MapCollider GetMapCollider | ( | int | index | ) |
| MapCollider GetMapCollider | ( | PolygonCollider2D | collider | ) |
PolygonCollider2DからMapColliderを取得する。
| collider | PolygonCollider2D |
| MapCollider GetMapCollider | ( | Cell | cell | ) |
| Point2 LocalPointToMapPoint | ( | Vector3 | localPos | ) |
ローカル座標からMap座標に変換。
| localPos | ローカル座標 |
| Vector3 MapPointToLocalPoint | ( | Point2 | pos | ) |
Map座標からローカル座標に変換。
| pos | 座標 |
| Vector3 MapPointToWorldPoint | ( | Point2 | pos | ) |
Map座標からワールド座標に変換。
| pos | 座標 |
| delegate void OnRepainted | ( | ) |
再描画時のコールバックdelegate
StampでTileを塗る
true, 塗ることができた。 false それ以外 | pos | 座標 |
| stamp | Stamp |
| autoTiling | trueを設定した場合オートタイル。 |
| isCreateCellObject | CellObjectを作成するかどうか |
| bool PutTile | ( | Point2 | pos, |
| Tile | tile, | ||
| int | partsID, | ||
| Point2 | tilePos, | ||
| bool | autoTiling, | ||
| bool | changeParts, | ||
| bool | isCreateCellObject | ||
| ) |
Tile配置
true, 配置できた。 false それ以外。 | pos | 座標 |
| tile | Tile |
| partsID | パーツID |
| tilePos | Tileの位置 |
| autoTiling | trueを設定した場合オートタイル。 |
| changeParts | trueを設定した場合パーツ変更。 |
| isCreateCellObject | CellObjectを作成するかどうか |
| bool Raycast | ( | Ray | ray, |
| ref Vector2 | localPos | ||
| ) |
レイからローカル座標を取得。
| ray | レイ |
| localPos | ローカル座標 |
| bool RayToPoint | ( | Ray | ray, |
| out Point2 | pos | ||
| ) |
レイからMap座標に変換。
true, レイ上にMapがある。 false それ以外。 | ray | レイ |
| pos | 座標 |
| bool Refresh | ( | ) |
Cellを再構築します。 TileSetを更新した場合などに呼び出してください。
| Async RefreshAsync | ( | ) |
非同期でCellを再構築します。 TileSetを更新した場合などに呼び出してください。
| bool RemoveBucketTile | ( | Point2 | pos, |
| bool | autoTiling | ||
| ) |
バケツ形式でのTile削除。
true, Tile削除できた。 false それ以外。 | pos | 座標 |
| autoTiling | trueを設定した場合オートタイル。 |
バケツ形式でのTile削除(非同期)
| pos | 座標 |
| autoTiling | trueを設定した場合オートタイル。 |
| bool RemoveRectangleTile | ( | Point2 | pos, |
| int | width, | ||
| int | height, | ||
| bool | autoTiling | ||
| ) |
矩形指定でのTile削除。
true, Tile削除できた。 false それ以外。 | pos | 座標 |
| width | 横幅 |
| height | 縦幅 |
| autoTiling | trueを設定した場合オートタイル。 |
矩形指定でのTile削除(非同期)。
| pos | 座標 |
| width | 横幅 |
| height | 縦幅 |
| autoTiling | trueを設定した場合オートタイル。 |
| void RemoveStamp | ( | Stamp | stamp | ) |
Stampを削除する
| stamp | 削除するStamp |
| bool RemoveTile | ( | Cell | cell, |
| bool | autoTiling | ||
| ) |
| bool RemoveTile | ( | Point2 | pos, |
| bool | autoTiling | ||
| ) |
Tile削除。
true, Tile削除できた。 false それ以外。 | pos | 座標 |
| autoTiling | trueを設定した場合オートタイル。 |
| void Repaint | ( | ) |
再描画する
| void Resize | ( | int | width, |
| int | height, | ||
| HorizontalPivot | horizontalPivot, | ||
| VerticalPivot | verticalPivot | ||
| ) |
サイズ変更。
| width | 横幅 |
| height | 縦幅 |
| horizontalPivot | 横方向のピボット |
| verticalPivot | 縦方向のピボット |
| void SetDirty | ( | bool | repaint | ) |
メッシュを再構築するように設定します。 Cellを直接変更した際に呼び出してください。
| repaint | 再描画するかどうか |
| bool UpdateAutoTiles | ( | HashSet< Point2 > | points, |
| bool | aroundOnly = false |
||
| ) |
オートタイルによるCellの更新処理
| points | 更新する座標 |
| aroundOnly | 周辺のみ更新するかどうか |
| bool UpdateCollider | ( | Cell | cell | ) |
CellのColliderの状態を更新する。
| cell | Colliderを更新するCell |
| void UpdateMapCollider | ( | ) |
MapColliderを更新する。
| Point2 WorldPointToMapPoint | ( | Vector3 | worldPos | ) |
ワールド座標からMap座標に変換。
| worldPos | ワールド座標 |
|
get |
Cellの数を取得
|
get |
チャンクの数を取得
|
getset |
マテリアルカラーの取得/設定。
|
getset |
マップ端とオートタイルを結合するかどうか
|
get |
縦幅を取得。
縦幅。
|
get |
Canvasにレンダリングするかどうか。 MapゲームオブジェクトがRectTransformを持つ場合にCanvasモードとなる。
|
get |
MapColliderの数を取得
|
staticget |
Mapの数を取得
|
get |
マテリアルを取得
|
getset |
SortingLayerIDの取得/設定。
|
getset |
sortingOrderの取得/設定。
|
get |
Stampの数を取得
|
get |
横幅を取得。
横幅。
| OnRepainted onRepainted |
再描画時のコールバックイベント