Cells API

advanced scripting

Terrain Grid System 2 · Scripting Support (C#)

Note: This is an exhaustive index of public members for this API area. Signatures may vary by version; rely on your IDE/autocomplete and the source if needed.

API Reference

Properties

List<int> borderCellIndices

List of cell indices that form the border

List<Vector3> borderVertices

List of border vertex positions in world space

bool cellAlphaClipping

Enables/disables alpha clipping (Review: verify this description matches current behavior.)

float cellAlphaTestThreshold

Sets/get cell alpha clipping threshold

float cellBorderAlpha

Cell border alpha.

Color cellBorderColor

Cells border color

float cellBorderThickness

Cells border thickness

bool cellCustomBorderThickness

Enables cells custom border thickness

float cellFillPadding

Padding applied to cell fill with color/texture

Color cellHighlightBorderColor

Color for the highlight border (Review: verify this description matches current behavior.)

float cellHighlightBorderSize

Width of the highlight border (only box grids) (Review: verify this description matches current behavior.)

Color cellHighlightColor

Fill color to use when the mouse hovers a cell's region.

Color cellHighlightColor2

Alternate fill color to use when the mouse hovers a cell's region.

Cell cellHighlighted

Returns Cell under mouse position or null if none.

int cellHighlightedIndex

Returns current highlighted cell index.

bool cellHighlightNonVisible

Gets or sets whether invisible cells should also be highlighted when pointer is over them

bool cellHighlightUseCellColor

Instead of using the highlight color, use the cell color if it's set

int cellLastClickedIndex

Returns Cell index which has been clicked

List<Cell> cells

Cells in this region.

List<Cell> cells

Cells.

VoronoiCell[] cells

Cells.

List<Cell> cells

Complete array of states and cells and the territory name they belong to.

bool cellsFlat

Gets or sets if cells are rendered as horizontal flat surfaces ignoring any terrain slope.

Vector2 cellSize

Gets current individual cell size or sets user defined cell size

float cellsMaxHeightDifference

Gets or sets the cells max height different between vertices. Cells with a greater difference than this threshold will be hidden.

float cellsMaximumAltitude

Gets or sets the maximum cell altitude. Useful to hide cells above certain altitude.

bool cellsMaximumAltitudeClampVertices

Clamps vertices above the maximum altitude (Review: verify this description matches current behavior.)

float cellsMaxSlope

Gets or sets the cells max slope. Cells with a greater slope will be hidden.

float cellsMinimumAltitude

Gets or sets the minimum cell altitude. Useful to hide cells under certain altitude, for instance, under water.

bool cellsMinimumAltitudeClampVertices

Clamps vertices below the minimum altitude (Review: verify this description matches current behavior.)

CELL_TEXTURE_MODE cellTextureMode

Returns the cells texture mode. Usually texturing is done inside the cell shape or using a quad floating on top of the cell.

CELL_TILE_BACKGROUND_MODE cellTileBackgroundMode

Returns the cells texture transparent mode when rendering in "Floating" mode.

Vector2 cellTileOffset

Returns the default scale for cell tiles

Vector2 cellTileScale

Returns the default scale for cell tiles

Texture2D gridFlatMask

Gets or sets the "flat" mask. The alpha component of this texture is used to determine if a cell should be rendered flat or adapt to terrain otherwise.

bool hasBakedVoronoi

Has baked voronoi.

bool hideIsolatedCells

If enabled, cells with no visible neighbors after other visibility rules are applied will be hidden.

int numCells

Gets or sets the desired number of cells in irregular topology.

bool showCells

Toggle cells frontiers visibility.

byte[] voronoiSerializationData

Gets baked Voronoi cells

List<Vector2> voronoiSites

Sets or gets a list of Voronoi sites. Full list will be completed with random number up to numCells amount.

Methods

void CellExpandSelection(List<int> cellIndices)

Adds surrounding cells to a list of given cells

void CellGetAdjacents(Vector2 v1, Vector2 v2, out Cell cell1, out Cell cell2)

Returns two adjacent cells that share an edge defined by v1 and v2 in local coordinates

Cell CellGetAtLocalPosition(Vector3 position, int territoryIndex = -1)

Returns the cell object under position in local or worldSpace coordinates

Returns: The get at position.

Cell CellGetAtMousePosition()

Returns the cell at the mouse position

Cell CellGetAtPosition(Vector3 position, bool worldSpace = false, int territoryIndex = -1)

Returns the cell object under position in local or worldSpace coordinates

Obsolete: Use CellGetAtWorldPosition or CellGetAtLocalPosition

Returns: The get at position.

Cell CellGetAtPosition(int column, int row)

Returns the cell located at given row and column

Cell CellGetAtWorldPosition(Vector3 position, int territoryIndex = -1)

Returns the cell object under position in local or worldSpace coordinates

Returns: The get at position.

CellBorderData CellGetBorderData(List<int> cellIndices, float expand = 1f)

Returns the border cells and border vertices for the given cell indices. Similar to CellDrawBorder but returns data instead of drawing.

CellBorderData CellGetBorderData(int cellIndex, float expand = 1f)

Returns the border cells and border vertices for a single cell.

CellBorderData CellGetBorderData(List<Cell> cells, float expand = 1f)

Returns the border cells and border vertices for a list of cells.

Bounds CellGetBounds(int cellIndex)

Returns the rect enclosing the cell in world space. Same than CellGetRectWorldSpace.

int CellGetBoxDistance(int startCellIndex, int endCellIndex)

Returns the number of steps between two cells in box topology. This method does not take into account cell masks or blocking cells. It just returns the distance.

bool CellGetCanCross(int cellIndex)

Returns true if a given cell can be crossed by using the pathfinding engine.

Vector3 CellGetCentroid(int cellIndex, bool worldSpace = true)

Gets the cell's centroid in world space.

Color CellGetColor(int cellIndex)

Returns current cell's fill color

int CellGetColumn(int cellIndex)

Returns cell's column or -1 if cellIndex is not valid.

string CellGetConfigurationData()

Deprecated: Use CellGetSettings instead.

Returns a string-packed representation of current cells settings. Each cell separated by ; Individual settings mean: Position Meaning 0 Visibility (0 = invisible, 1 = visible) 1 Territory Index 2 Color R (0..1) 3 Color G (0..1) 4 Color B (0..1) 5 Color A (0..1) 6 Texture Index 7 Cell tag 8 Can cross? (pathfinding)

Obsolete: Use CellGetSettings instead

Returns: The get configuration data.

float CellGetCrossCost(int cellIndex)

Returns the cost of entering or exiting a given hexagonal cell without specifying a specific edge. This method is used along CellSetCrossCost which doesn't take into account per-edge costs.

float CellGetCrossCost(int cellStartIndex, int cellEndIndex)

Returns the cost of going from one cell to another (both cells must be adjacent)

Returns: The get cross cost.

GameObject CellGetExtrudedGameObject(int cellIndex, float extrusionAmount = 1f)

Extrudes the surface of a cell

int CellGetFromGroup(int group, int[] indices, bool useBitWiseComparison = false)

Returns the indices of all cells belonging to a group in the indices array which must be fully allocated when passed. Also the length of this array determines the maximum number of indices returned. This method returns the actual number of indices returned, regardless of the length the array. This design helps reduce heap allocations.

int CellGetFromGroup(int group, List<int> indices, bool useBitWiseComparison = false)

Returns the indices of all cells belonging to a group in the indices array which must be fully allocated when passed. Also the length of this array determines the maximum number of indices returned. This method returns the actual number of indices returned, regardless of the length the array. This design helps reduce heap allocations.

GameObject CellGetGameObject(int cellIndex)

Returns the shape/surface gameobject of the cell.

Returns: The get game object.

int CellGetGroup(int cellIndex)

Returns cell group (default 1)

int CellGetHexagonDistance(int startCellIndex, int endCellIndex)

Returns the hexagon distance between two cells (number of steps to reach end cell from start cell). This method does not take into account cell masks or blocking cells. It just returns the distance.

Returns: The get hexagon distance.

int CellGetInArea(Bounds bounds, List<int> cellIndices, float padding = 0, bool checkAllVertices = false)

Returns the indices of the cells within or under a volume

int CellGetInArea(GameObject gameObject, List<int> cellIndices, float padding = 0, bool checkAllVertices = false)

Returns the indices of the cells within or under a volume

int CellGetInArea(Vector2 localStartPos, Vector2 localEndPos, List<int> cellIndices, float paddingInLocalSpace = 0, bool checkAllVertices = false)

Returns the indices of the cells within or under a volume

int CellGetInArea(BoxCollider boxCollider, List<int> cellIndices, int resolution, float padding = 0, float offset = 0)

Returns the indices of the cells under a box collider

int CellGetIndex(Cell cell)

Returns the index of a cell in the cells array by its reference.

int CellGetIndex(int row, int column, bool clampToBorders = true)

Returns the index of a cell by its row and column numbers.

Returns: The get index.

int CellGetIndex(Vector3 position, bool worldSpace = false)

Returns the cell index of a cell at a given position (in local or world space) in the grid

void CellGetLine(int startCellIndex, int endCellIndex, ref List<int> cellIndices, ref List<Vector3> worldPositions, int lineResolution = 2)

Returns a line composed of cells and world positions from starting cell to ending cell

Returns: true, if there's a straight path of non-blocking cells between the two positionsfalse otherwise.

bool CellGetLineOfSight(Vector3 startPosition, Vector3 endPosition, ref List<int> cellIndices, ref List<Vector3> worldPositions, int cellGroupMask = -1, int lineResolution = 2, bool exhaustiveCheck = false, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, bool checkLastCell = false)

Traces a line between two positions and check if there's no cell blocking the line

Returns: true, if there's a straight path of non-blocking cells between the two positionsfalse otherwise.

bool CellGetLineOfSight(int startCellIndex, int endCellIndex, ref List<int> cellIndices, ref List<Vector3> worldPositions, int cellGroupMask = -1, int lineResolution = 2, bool exhaustiveCheck = false, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, bool checkLastCell = false, bool bidirectionalCheck = false)

Traces a line between two positions and check if there's no cell blocking the line

Returns: true, if there's a straight path of non-blocking cells between the two positionsfalse otherwise.

int CellGetNeighbor(int cellIndex, CELL_SIDE side)

Returns the index of an ajacent cell by the side name

List<Cell> CellGetNeighbors(Cell cell)

Returns a list of neighbor cells for specificed cell.

List<Cell> CellGetNeighbors(int cellIndex)

Returns a list of neighbor cells for specificed cell index.

int CellGetNeighbors(int cellIndex, List<Cell> neighbors)

Returns a list of neighbor cells for specificed cell index.

int CellGetNeighbors(int cellIndex, List<int> neighbors)

Returns a list of neighbor cells for specificed cell index.

List<int> CellGetNeighbors(Cell cell, int maxSteps = -1, int cellGroupMask = -1, float maxSearchCost = 0, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, int maxResultsCount = int.MaxValue, bool cellGroupMaskExactComparison = false, CellFilterDelegate filter = null)

Get a list of cells which are nearer than a given distance in cell count

List<int> CellGetNeighbors(int cellIndex, int maxSteps = -1, int cellGroupMask = -1, float maxSearchCost = 0, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, int maxResultsCount = int.MaxValue, bool cellGroupMaskExactComparison = false, CellFilterDelegate filter = null)

Get a list of cells which are nearer than a given distance in cell count

int CellGetNeighbors(int cellIndex, int maxSteps, List<int> cellIndices, int cellGroupMask = -1, float maxSearchCost = 0, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, int maxResultsCount = int.MaxValue, bool ignoreCellCosts = false, bool includeInvisibleCells = true, bool cellGroupMaskExactComparison = false, CellFilterDelegate filter = null)

Get a list of cells which are nearer than a given distance in cell count

List<int> CellGetNeighborsWithinRange(int cellIndex, int minSteps, int maxSteps, int cellGroupMask = -1, float maxCost = -1, bool includeInvisibleCells = true, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, bool ignoreCellCosts = false, bool cellGroupMaskExactComparison = false, CellFilterDelegate filter = null)

Get a list of cells which are nearer than a given distance in cell count

Vector3 CellGetNormal(int cellIndex)

Returns the normal at the center of a cell

Returns: The normal in world space coordinates.

bool CellGetOverlayMode(int cellIndex)

Returns true if cell is in overlay mode

Vector3 CellGetPosition(int cellIndex, bool worldSpace = true, float elevation = 0)

Gets the cell's center position in world space or local space.

Vector3 CellGetPosition(Cell cell, bool worldSpace = true, float elevation = 0)

Gets the cell's center position in world space or local space.

Rect CellGetRect(int cellIndex)

Returns the rect enclosing the cell in local space coordinates

Bounds CellGetRectWorldSpace(int cellIndex)

Returns the rect enclosing the cell in world space

int CellGetRow(int cellIndex)

Returns cell's row or -1 if cellIndex is not valid.

TGSConfigEntry[] CellGetSettings()

Returns an array with the main settings of each cell.

TGSConfigEntry[] CellGetSettings(bool onlyCustomized)

Performs cell get settings.

bool CellGetSideBlocksLOS(int cellIndex, CELL_SIDE side, CELL_DIRECTION direction = CELL_DIRECTION.Any)

Returns true if the side of a cell blocks LOS.

float CellGetSideCrossCost(int cellIndex, CELL_SIDE side, CELL_DIRECTION direction = CELL_DIRECTION.Any)

Gets the cost of crossing any hexagon side. (Review: verify this description matches current behavior.)

int CellGetTag(int cellIndex)

Returns the tag value of a given cell.

int CellGetTerritoryIndex(int cellIndex)

Returns cell's territory index to which it belongs to, or -1 if error.

int CellGetTerritoryRegionIndex(int cellIndex)

Returns cell's territory region index to which it belongs to, or -1 if error.

Texture2D CellGetTexture(int cellIndex)

Returns current cell's fill texture

int CellGetTextureIndex(int cellIndex)

Returns current cell's fill texture index (if texture exists in textures list). Texture index is from 1..32. It will return 0 if texture does not exist or it does not match any texture in the list of textures.

Vector2 CellGetTextureOffset(int cellIndex)

Returns the offset of the texture of a given cell

Vector2 CellGetTextureScale(int cellIndex)

Returns the scale of the texture of a given cell

int CellGetVertexCount(int cellIndex)

Returns the number of vertices of the cell

Vector3 CellGetVertexPosition(int cellIndex, int vertexIndex)

Returns the world space position of the vertex (Review: verify this description matches current behavior.)

Vector2 CellGetViewportSize(int cellIndex)

Returns the size in normalized viewport coordinates (0..1) for the given cell if that cell was on the center of the screen

Returns: The get rect screen space.

int CellGetWithinCone(int cellIndex, Vector2 direction, float maxDistance, float angle, List<int> cellIndices)

Returns a list of cells contained in a cone defined by a starting cell, a direction, max distance and an angle for the cone

Returns: The number of found cells (-1 if some index is out of range)

int CellGetWithinCone(int cellIndex, int targetCellIndex, float angle, List<int> cellIndices)

Returns a list of cells contained in a cone defined by a starting cell, a target cellIndex, a max distance and an angle for the cone

Returns: The number of found cells (-1 if some index is out of range)

Cell CellGetWithTag(int tag)

Retrieves Cell object with associated tag.

bool CellHasBorderVisible(int cellIndex)

Returns the state of the border visibility after CellSetBorderVisible has been called

bool CellIsAdjacentToCell(int cellIndex, int otherCellIndex)

Checks if the given cell is neighbor of another cell

bool CellIsAdjacentToTerritory(int cellIndex, int territoryIndex)

Checks if the given cell is neighbor of the territory

bool CellIsBorder(int cellIndex)

Performs cell is border.

bool CellIsVisible(int cellIndex)

Returns true if cell is visible

bool CellTestLineOfSight(int startCellIndex, int endCellIndex, int cellGroupMask = -1, int lineResolution = 2, bool exhaustiveCheck = false, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, bool checkLastCell = false)

Checks if there's line of sight (LOS) between two cells

Returns: true, if there's a straight path of non-blocking cells between the two positionsfalse otherwise.

void CellTestLineOfSight(int startCellIndex, List<int> targetCellIndices, int cellGroupMask = -1, int lineResolution = 2, bool exhaustiveCheck = false, CanCrossCheckType canCrossCheckType = CanCrossCheckType.Default, bool checkLastCell = false)

Removes any cell from a givel list of indices which are not in LOS

enum CELL_TEXTURE_MODE
enum CELL_TILE_BACKGROUND_MODE
bool CellMerge(Cell cell1, Cell cell2)

Merges cell2 into cell1. Cell2 is removed. Only cells which are neighbors can be merged.

void CellRemove(int cellIndex)

Removes a cell from the cells and territories lists. Note that this operation only removes cell structure but does not affect polygons - mostly internally used

void CellRemove(Cell cell)

Removes a cell from the cells and territories lists. Note that this operation only removes cell structure but does not affect polygons - mostly internally used

void CellScaleSurface(int cellIndex, float scale)

Escales the gameobject of a colored/textured surface (Review: verify this description matches current behavior.)

void CellSetBorderVisible(int cellIndex, bool visible)

Specifies if a given cell's border is visible.

void CellSetCanCross(int cellIndex, bool canCross)

Specifies if a given cell can be crossed by using the pathfinding engine.

void CellSetCanCross(List<int> cellIndices, bool canCross)

Specifies if a list of cells can be crossed by using the pathfinding engine.

void CellSetColor(int cellIndex, Color color)

Sets current cell's fill color. Use CellToggleRegionSurface for more options

void CellSetColor(Cell cell, Color color)

Sets current cell's fill color. Use CellToggleRegionSurface for more options

void CellSetColor(List<int> cellIndices, Color color)

Sets cells' fill color.

void CellSetColor(List<Cell> cellIndices, Color color)

Sets cells' fill color.

void CellSetConfigurationData(string cellData, int[] filterTerritories)

Deprecated: Use CellSetSettings instead.

Sets cell configuration data from a string

Obsolete: Use CellSetSettings instead

void CellSetCrossCost(int cellIndex, float cost, CELL_DIRECTION direction = CELL_DIRECTION.Entering)

Sets cost of entering or exiting a given hexagonal cell across any edge.

void CellSetCrossCost(int cellStartIndex, int cellEndIndex, float cost)

Sets the cost for going from one cell to another (both cells must be adjacent).

void CellSetGroup(int cellIndex, int group)

Specifies the cell group (by default 1) used by FindPath cellGroupMask optional argument

GameObject CellSetMaterial(int cellIndex, Material material)

Assigns a custom material to a cell

void CellSetOverlayMode(int cellIndex, bool overlayMode)

Sets a cell overlay mode by setting the material

void CellSetSettings(TGSConfigEntry[] cellSettings, int[] filterTerritories, bool entriesHaveIndices = false)

Performs cell set settings.

void CellSetSideBlocksLOS(int cellIndex, CELL_SIDE side, bool blocks, CELL_DIRECTION direction = CELL_DIRECTION.Any)

Makes a side of a cell block the LOS.

void CellSetSideCrossCost(int cellIndex, CELL_SIDE side, float cost, CELL_DIRECTION direction = CELL_DIRECTION.Any)

Sets the additional cost of crossing an hexagon side. (Review: verify this description matches current behavior.)

void CellSetSplatmapOpacity(int cellIndex, int splatmapIndex, float opacity, bool hideOtherLayers = false)

Sets the underline splatmap opacity of a cell. Optionally hide other terrain layers.

void CellSetTag(Cell cell, int tag)

Tags a cell with a user-defined integer tag. Cell can be later retrieved very quickly using CellGetWithTag.

void CellSetTag(int cellIndex, int tag)

Tags a cell with a user-defined integer tag. Cell can be later retrieved very quickly using CellGetWithTag.

bool CellSetTerritory(int cellIndex, int territoryIndex)

Sets the territory of a cell triggering territory boundary recalculation. Note: changes are not applied immediately, but at end of frame. To apply changes immediately, call Redraw()

Returns: true, if cell was transferred., false otherwise.

bool CellSetTerritory(List<int> cellIndices, int territoryIndex)

Sets the territory of a cell triggering territory boundary recalculation

Returns: true, if cell was transferred., false otherwise.

void CellSetTexture(Cell cell, Texture2D texture, bool isCanvasTexture = false, float textureScale = 1f)

Sets current cell's fill texture. Use CellToggleRegionSurface for more options

void CellSetTexture(int cellIndex, Texture2D texture, bool isCanvasTexture = false, float textureScale = 1f)

Sets current cell's fill texture. Use CellToggleRegionSurface for more options

void CellSetTexture(Cell cell, Texture2D texture, Color tintColor, bool isCanvasTexture = false)

Sets current cell's fill texture. Use CellToggleRegionSurface for more options

void CellSetTexture(int cellIndex, Texture2D texture, Color tintColor, bool isCanvasTexture = false, float textureScale = 1f)

Sets current cell's fill texture. Use CellToggleRegionSurface for more options

void CellSetTexture(Cell cell, Texture2D texture, Color tintColor, Vector2 textureScale, Vector2 textureOffset, bool isCanvasTexture = false)

Sets current cell's fill texture. Use CellToggleRegionSurface for more options

void CellSetTexture(int cellIndex, Texture2D texture, Color tintColor, Vector2 textureScale, Vector2 textureOffset, float textureRotation = 0, bool isCanvasTexture = false)

Sets current cell's fill texture. Use CellToggleRegionSurface for more options

void CellSetVisible(int cellIndex, bool visible, bool excludeFromAnyTerritory = false)

Specifies if a given cell is visible.

void CellSetVisible(List<int> cellIndices, bool visible, bool excludeFromAnyTerritory = false)

Specifies if a given cell is visible.

void CellSetVisible(List<Cell> cells, bool visible, bool excludeFromAnyTerritory = false)

Specifies if a given cell is visible.

bool CellSetVisible(Rect rect, bool visible, bool worldSpace = false)

Specified visibility for a group of cells that lay within a given rectangle

bool CellSetVisible(GameObject obj, bool visible)

Specified visibility for a group of cells that lay within a given gameObject

bool CellSetVisible(Renderer renderer, bool visible)

Specified visibility for a group of cells that lay within a given gameObject

bool CellSetVisible(Collider collider, bool visible)

Specified visibility for a group of cells that lay within a given collider

bool CellSetVisible(Bounds bounds, bool visible)

Specified visibility for a group of cells that lay within a given bounds

void CellToggleRegionSurface(int cellIndex, bool visible)

Toggles visibility of the surface of a cell

GameObject CellToggleRegionSurface(int cellIndex, bool visible, Texture2D texture, bool isCanvasTexture = false)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

GameObject CellToggleRegionSurface(int cellIndex, bool visible, Color color, bool refreshGeometry = false)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

GameObject CellToggleRegionSurface(int cellIndex, bool visible, Color color, bool refreshGeometry, int textureIndex, bool isCanvasTexture = false)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

GameObject CellToggleRegionSurface(int cellIndex, bool visible, Color color, bool refreshGeometry, Texture2D texture, bool isCanvasTexture = false, float textureScale = 1f)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

GameObject CellToggleRegionSurface(int cellIndex, bool visible, Color color, bool refreshGeometry, int textureIndex, Vector2 textureScale, Vector2 textureOffset, bool isCanvasTexture = false)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

GameObject CellToggleRegionSurface(int cellIndex, bool visible, Color color, bool refreshGeometry, Texture2D texture, Vector2 textureScale, Vector2 textureOffset, float textureRotation = 0, bool localSpace = false, bool isCanvasTexture = false)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

GameObject CellToggleRegionSurface(Cell cell, bool visible, Color color, bool refreshGeometry, Texture2D texture, Vector2 textureScale, Vector2 textureOffset, float textureRotation, bool overlay, bool localSpace, bool isCanvasTexture = false)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

GameObject CellToggleRegionSurface(int cellIndex, bool visible, Color color, bool refreshGeometry, Texture2D texture, Vector2 textureScale, Vector2 textureOffset, float textureRotation, bool overlay, bool localSpace, bool isCanvasTexture)

Colorize specified region of a cell by indexes.

Returns: The generated color surface positioned and oriented over the given cell.

CELL_SIDE GetSideByVector(Vector2 dir)

Returns the side of the cell that is closest to the given vector

int TerritoryGetIndex(Territory territory)

Returns the index of a territory in the territory array by its reference.

GameObject CellAddSprite(int cellIndex, Sprite sprite, bool adjustScale = true)

Creates a gameobject with SpriteRenderer and places it on top of the cell

void CellClear(int cellIndex)

Removes any color or texture from a cell and hides it

void CellClear(List<int> cellIndices)

Removes any color or texture from a list of cells and hides them

void CellDestroyBorder(int cellIndex)

Destroys a custom border previous drawn using CellDrawBorder

void CellDestroySurface(int cellIndex)

Destroys a cell surface and removes it from internal caches

GameObject CellDrawBorder(Cell cell, Color color = default(Color), float thickness = 0, float expand = 1f)

Creates a gameobject with the border for the given cell.

GameObject CellDrawBorder(int cellIndex, Color color = default(Color), float thickness = 0, float expand = 1f)

Creates a gameobject with the border for the given cell.

GameObject CellDrawBorder(List<Cell> cells, Color color = default(Color), float thickness = 1f, float expand = 1f)

Performs cell draw border.

GameObject CellDrawBorder(List<int> cellIndices, Color color = default(Color), float thickness = 1f, float expand = 1f)

Performs cell draw border.

void CellHideRegionSurface(int cellIndex)

Uncolorize/hide specified cell by index in the cells collection.

void CellHideRegionSurfaces()

Uncolorize/hide specified all cells.

void CellBlink(Cell cell, Color color1, Color color2, float duration = 2f, int repetitions = 1)

Blinks a cell with colors "color1" and "color2" and "duration" in seconds.

void CellBlink(int cellIndex, Color color1, Color color2, float duration = 2f, int repetitions = 1)

Blinks a cell with colors "color1" and "color2" and "duration" in seconds.

void CellBlink(List<int> cellIndices, Color color1, Color color2, float duration = 2f, int repetitions = 1)

Blinks a list of cells with colors "color1" and "color2" and "duration" in seconds.

void CellBlink(List<Cell> cells, Color color1, Color color2, float duration = 2f, int repetitions = 1)

Blinks a list of cells with colors "color1" and "color2" and "duration" in seconds.

void CellBlink(Cell cell, Color color, float duration = 2f, int repetitions = 1)

Blinks a cell with "color" and "duration" in seconds.

void CellBlink(int cellIndex, Color color, float duration = 2f, int repetitions = 1)

Blinks a cell with "color" and "duration" in seconds.

void CellBlink(List<int> cellIndices, Color color, float duration = 2f, int repetitions = 1)

Blinks a list of cells with "color" and "duration" in seconds.

void CellBlink(List<Cell> cells, Color color, float duration = 2f, int repetitions = 1)

Blinks a list of cells with "color" and "duration" in seconds.

void CellCancelAnimations(int cellIndex, float fadeOutDuration = 0)

Cancels any ongoing visual effect on a cell

void CellCancelAnimations(List<int> cellIndices, float fadeOutDuration = 0)

Cancels any ongoing visual effect on a list of cells

void CellColorTemp(int cellIndex, Color color, float duration = 2f)

Temporarily colors a cell for "duration" in seconds.

void CellColorTemp(Cell cell, Color color, float duration = 2f, int repetitions = 1)

Temporarily colors a cell for "duration" in seconds.

void CellColorTemp(List<int> cellIndices, Color color, float duration = 2f, int repetitions = 1)

Temporarily colors a list of cells for "duration" in seconds.

void CellColorTemp(List<Cell> cells, Color color, float duration = 2f, int repetitions = 1)

Temporarily colors a list of cells for "duration" in seconds.

void CellFadeOut(Cell cell, Color color, float duration = 2f)

Colors a cell and fades it out for "duration" in seconds.

void CellFadeOut(int cellIndex, Color color, float duration = 2f, int repetitions = 1)

Colors a cell and fades it out during "duration" in seconds.

void CellFadeOut(List<int> cellIndices, Color color, float duration = 2f, int repetitions = 1)

Fades out a list of cells with "color" and "duration" in seconds.

void CellFlash(int cellIndex, Color color, float duration = 2f, int repetitions = 1)

Flashes a cell with "color" and "duration" in seconds.

void CellFlash(Cell cell, Color color, float duration = 2f, int repetitions = 1)

Flashes a cell with "color" and "duration" in seconds.

void CellFlash(List<int> cellIndices, Color color, float duration = 2f, int repetitions = 1)

Flashes a list of cells with "color" and "duration" in seconds.

void CellFlash(List<Cell> cells, Color color, float duration = 2f, int repetitions = 1)

Flashes a list of cells with "color" and "duration" in seconds.

void CellFlash(Cell cell, Color initialColor, Color color, float duration = 2f, int repetitions = 1)

Flashes a cell from "initialColor" to "color" and "duration" in seconds.

void CellFlash(int cellIndex, Color initialColor, Color color, float duration = 2f, int repetitions = 1)

Flashes a cell from "initialColor" to "color" and "duration" in seconds.

void CellFlash(List<int> cellIndices, Color initialColor, Color color, float duration = 2f, int repetitions = 1)

Flashes a list of cells from "initialColor" to "color" and "duration" in seconds.

void CellFlash(List<Cell> cells, Color initialColor, Color color, float duration = 2f, int repetitions = 1)

Flashes a list of cells from "initialColor" to "color" and "duration" in seconds.

void CancelAnimations(float fadeOutDuration = 0)

Cancels any ongoing visual effect on any cell

void CellsReset(List<int> cellIndices)

Resets the cells to their default state

GameObject DrawLine(int cellIndex, CELL_SIDE side, Color color, float width)

Draws a line over a cell side.

Returns: The line.

GameObject DrawLine(int cellIndex1, int cellIndex2, Color color, float width)

Draws a line connecting two cells centers

Returns: The line.

void RedrawCells(List<Cell> cells)

Updates grid mesh to reflect only specific cells

void WarmCells()

Pregenerates and caches cell geometry for faster performance during gameplay

Types & Delegates

class CellBorderData

Data structure containing border cells and border vertices.

CellBorderData()

Performs cell border data.

delegate bool CellFilterDelegate(int cellIndex)
Was this page helpful?