Table of Contents

Class GridBehaviour<TPoint>

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

Extend from this class to hook in your own grid initialization code.

[Version(1, 8, 0)]
public class GridBehaviour<TPoint> : GLMonoBehaviour where TPoint : IGridPoint<TPoint>

Type Parameters

TPoint
Inheritance
GridBehaviour<TPoint>
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

Remarks

This is also a useful place for other logic that interacts with the grid(typically, your game logic). It has properties to access the grid and map.

You cannot use this to customize the shape or map of the grid (instead, use CustomGridBuilder and CustomMapBuilder).

Properties

Grid

The grid data structure, containing cells as elements.

(It's likely that this will return a grid of a different (more general) cell type in the future).

public IGrid<TileCell, TPoint> Grid { get; }

Property Value

IGrid<TileCell, TPoint>

GridBuilder

Returns the grid builder attached to the same game object as this grid behaviour.

(It's provided, but you will mostly need only the Grid and Map.)

public TileGridBuilder<TPoint> GridBuilder { get; }

Property Value

TileGridBuilder<TPoint>

Map

The map used to build the grid.

public IMap3D<TPoint> Map { get; }

Property Value

IMap3D<TPoint>

MousePosition

Get's the mouse position in Grid coordinates.

Currently it is only useful for 2D grids, rendered with orthographic cameras.

public TPoint MousePosition { get; }

Property Value

TPoint

Methods

InitGrid()

When this behaviour is attached to a grid builder, this method is called once the grid is created, and all cells(tiles) have been instantiated.

Override this to implement custom initialisation code. (You can access the grid through the Grid property).

public virtual void InitGrid()