Nostalgia  2.1.5
Cell Class Reference

Cell data are arranged on the grid. More...

Inheritance diagram for Cell:

Public Member Functions

delegate void DestroyCallbackFunction (Cell cell)
 Delegate method that is called when the Cell is destroyed More...
 
 Cell (Map map, Point2 position, Tile tile)
 Initializes a new instance of the Nostalgia.Cell class. More...
 
 Cell (Map map, Cell cell)
 Copy and initialize an existing Nostalgia.Cell instance. More...
 
void SetPartsIndex (int x, int y, int index)
 Sets the index of the parts. More...
 
int GetPartsIndex (int x, int y)
 Gets the index of the parts. More...
 
void SetVertexColor (int x, int y, int index, Color color)
 Sets the color of the vertex. More...
 
Color GetVertexColor (int x, int y, int index)
 Gets the color of the vertex. More...
 
bool CheckCombineMesh (Tile.Type tileType, out int partsIndex, out Color vertexColor)
 It determines whether or not to join the mesh More...
 

Static Public Member Functions

static int SetPartsIndex (int partsID, int x, int y, int index)
 Sets the index of the parts. More...
 
static int GetPartsIndex (int partsID, int x, int y)
 Gets the index of the parts. More...
 

Public Attributes

Map map
 Map More...
 
Point2 position
 The position. More...
 
int tileIDObsolete
 The tile index. More...
 
Tile tile
 Tile reference value More...
 
Point2 tilePos = Point2.zero
 Position within the Tile. More...
 
int partsID
 The parts ID. More...
 
Collider2D collider
 The collider. More...
 

Properties

bool hasCellObject [get]
 Whether or not you have a CellObject More...
 
CellObject cellObject [get, set]
 Get / Set the CellObject More...
 

Events

DestroyCallbackFunction destroyCallback
 Event that is called when the Cell is destroyed More...
 

Detailed Description

Cell data are arranged on the grid.

Constructor & Destructor Documentation

Cell ( Map  map,
Point2  position,
Tile  tile 
)

Initializes a new instance of the Nostalgia.Cell class.

Parameters
mapMap
positionPosition.
tileTile.
Cell ( Map  map,
Cell  cell 
)

Copy and initialize an existing Nostalgia.Cell instance.

Parameters
mapMap
cellSource cell

Member Function Documentation

bool CheckCombineMesh ( Tile.Type  tileType,
out int  partsIndex,
out Color  vertexColor 
)

It determines whether or not to join the mesh

Parameters
tileTypeTile type
partsIndexParts index
vertexColorVertex Color
Returns
true Capable of binding false Join not
delegate void DestroyCallbackFunction ( Cell  cell)

Delegate method that is called when the Cell is destroyed

Parameters
cellTo be destroyed Cell
static int GetPartsIndex ( int  partsID,
int  x,
int  y 
)
static

Gets the index of the parts.

Returns
The parts index.
Parameters
partsIDCurrent parts ID.
xThe x coordinate(between 0 and 1).
yThe y coordinate(between 0 and 1).
int GetPartsIndex ( int  x,
int  y 
)

Gets the index of the parts.

Returns
The parts index.
Parameters
xThe x coordinate(between 0 and 1).
yThe y coordinate(between 0 and 1).
Color GetVertexColor ( int  x,
int  y,
int  index 
)

Gets the color of the vertex.

Returns
The vertex color.
Parameters
xThe x coordinate(between 0 and 1).
yThe y coordinate(between 0 and 1).
indexVertex Index.
static int SetPartsIndex ( int  partsID,
int  x,
int  y,
int  index 
)
static

Sets the index of the parts.

Returns
The parts index.
Parameters
partsIDCurrent parts ID.
xThe x coordinate(between 0 and 1).
yThe y coordinate(between 0 and 1).
indexIndex.
void SetPartsIndex ( int  x,
int  y,
int  index 
)

Sets the index of the parts.

Parameters
xThe x coordinate(between 0 and 1).
yThe y coordinate(between 0 and 1).
indexIndex.
void SetVertexColor ( int  x,
int  y,
int  index,
Color  color 
)

Sets the color of the vertex.

Parameters
xThe x coordinate(between 0 and 1).
yThe y coordinate(between 0 and 1).
indexVertex Index.
colorVertex Color.

Member Data Documentation

Collider2D collider

The collider.

Map map

Map

int partsID

The parts ID.

Parts of the state auto tile.

Point2 position

The position.

Tile tile

Tile reference value

int tileIDObsolete

The tile index.

For deprecated, referring to the Nostalgia.Cell.tile.

Point2 tilePos = Point2.zero

Position within the Tile.

Property Documentation

CellObject cellObject
getset

Get / Set the CellObject

bool hasCellObject
get

Whether or not you have a CellObject

Event Documentation

DestroyCallbackFunction destroyCallback

Event that is called when the Cell is destroyed