Table of Contents

Class TileCell

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

A TileCell is a cell that is represented by a single Unity object.

They can be anything, including Sprites, Models, or compound objects, as long as they can be instantiated, and each corresponds to exactly one cell in a grid.They are used with TileGrid builders.

[Version(1, 8, 0)]
public abstract class TileCell : GLMonoBehaviour, IColorableCell, ICell
Inheritance
TileCell
Implements
Derived
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.runInEditMode
Component.GetComponent<T>()
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentsInParent<T>()
Component.transform
Component.gameObject
Component.tag
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.name
Object.hideFlags
Extension Methods

Properties

Center

The visual center of a cell.

This is useful for cells that do not have their actual pivot at the "expected" place, such as mesh tile cells in polar grids.

public Vector3 Center { get; }

Property Value

Vector3

Color

The main color of the tile.

This is used to set the color of tiles dynamically.

public abstract Color Color { get; set; }

Property Value

Color

Dimensions

The 2D dimensions of the tile. For 3D objects, this is the dimensions along the same plane as the 2D grid.

public abstract Vector2 Dimensions { get; }

Property Value

Vector2

__CenterOffset

Should be set by the grid creator to a value that can serve as the center of the cell(if the cell is at the origin).

public Vector3 __CenterOffset { get; set; }

Property Value

Vector3

Methods

AddAngle(float)

Adds the given angle to the current angle of the tile. If the tile is in the XY plane, it will be added to the Z angle.

public abstract void AddAngle(float angle)

Parameters

angle float

OnDrawGizmos()

Draws the Gizmos for this tile: a label with the tile name.

It is often convenient, for this reason, to make the tile name the coordinate of the tile.

public virtual void OnDrawGizmos()

SetAngle(float)

Sets the angle of the tile. If the tile is in the XY plane, the angle will be the Z angle.

public abstract void SetAngle(float angle)

Parameters

angle float

In degrees.

__UpdatePresentation(bool)

This methods is called by the editor, and is to update the cell representation to it's current state.

(Typically, this is necessary for serialized fields that affect the presentation.For example, the color may be saved, but the actual object may reset it's color).

public abstract void __UpdatePresentation(bool forceUpdate)

Parameters

forceUpdate bool