Table of Contents

Class MeshGridBuilder<TPoint>

Namespace
Gamelogic.Grids
Assembly
Assembly-CSharp.dll

Base class for tile grid builders where grid is rendered as a single mesh.

[Version(1, 14, 0)]
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
public abstract class MeshGridBuilder<TPoint> : GLMonoBehaviour, ITileGrid<TPoint>, IGridBuilderBase, IGLScriptableObject where TPoint : IGridPoint<TPoint>

Type Parameters

TPoint

The type of point of the grid that this builder is building.

Inheritance
MeshGridBuilder<TPoint>
Implements
ITileGrid<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

Fields

CenterRect

protected readonly Rect CenterRect

Field Value

Rect

alignment

[SerializeField]
[Tooltip("How the anchor of the grid lies relative to the grid.")]
protected MapAlignment alignment

Field Value

MapAlignment

cellDimensions

public Vector2 cellDimensions

Field Value

Vector2

cellSpacingFactor

[SerializeField]
[Tooltip("A factor that controls the spacing between cells.")]
protected Vector2 cellSpacingFactor

Field Value

Vector2

cells

[SerializeField]
protected MeshCell[] cells

Field Value

MeshCell[]

colorFunction

[SerializeField]
[Tooltip("The color function to use to color cells.")]
protected ColorFunction colorFunction

Field Value

ColorFunction

colors

[SerializeField]
[Tooltip("The colors to use to color cells.")]
[ContextMenuItem("Reset", "ResetColors")]
protected Color[] colors

Field Value

Color[]

customMap

protected IMap3D<TPoint> customMap

Field Value

IMap3D<TPoint>

dimensions

[SerializeField]
[Tooltip("The width and height of your shape (in cells).")]
protected InspectableVectorPoint dimensions

Field Value

InspectableVectorPoint

grid

protected IGrid<MeshCell, TPoint> grid

Field Value

IGrid<MeshCell, TPoint>

isInteractive

[SerializeField]
[Tooltip("Whether the grid will respond to mouse clicks")]
protected bool isInteractive

Field Value

bool

meshMap

protected IMeshMap<TPoint> meshMap

Field Value

IMeshMap<TPoint>

size

[SerializeField]
[Tooltip("The size of your shape (in cells).")]
protected int size

Field Value

int

textureHeight

public int textureHeight

Field Value

int

textureWidth

public int textureWidth

Field Value

int

updateType

[SerializeField]
[Tooltip("When to update the grid")]
protected UpdateType updateType

Field Value

UpdateType

useColor

[SerializeField]
[Tooltip("Whether to set cells colors")]
protected bool useColor

Field Value

bool

Properties

Alignment

public MapAlignment Alignment { get; set; }

Property Value

MapAlignment

CellSpacingFactor

public Vector2 CellSpacingFactor { get; set; }

Property Value

Vector2

ColorFunction

public ColorFunction ColorFunction { get; set; }

Property Value

ColorFunction

Colors

public Color[] Colors { get; set; }

Property Value

Color[]

Dimensions

Returns the dimensions for this grid if it makes sense for the current shape.

(The dimension field is hidden in the inspector if it does not make sense).

public VectorPoint Dimensions { get; set; }

Property Value

VectorPoint

Grid

Returns the grid built with this builder.

public IGrid<MeshCell, TPoint> Grid { get; protected set; }

Property Value

IGrid<MeshCell, TPoint>

Map

Returns the map this builder used to built the grid.

public IMap3D<TPoint> Map { get; protected set; }

Property Value

IMap3D<TPoint>

MousePosition

public TPoint MousePosition { get; }

Property Value

TPoint

Size

Returns the size for this grid if it makes sense for the current shape.

(The dimension field is hidden in the inspector if it does not make sense).

public int Size { get; set; }

Property Value

int

UseColor

public bool UseColor { get; set; }

Property Value

bool

Methods

CreateMap()

protected abstract IMap3D<TPoint> CreateMap()

Returns

IMap3D<TPoint>

CreateMeshMap()

protected abstract IMeshMap<TPoint> CreateMeshMap()

Returns

IMeshMap<TPoint>

GetAlignedMap(WindowedMap<TPoint>)

protected IMap3D<TPoint> GetAlignedMap(WindowedMap<TPoint> windowedHexMap)

Parameters

windowedHexMap WindowedMap<TPoint>

Returns

IMap3D<TPoint>

GetColorFunc(int, int, int)

protected abstract Func<TPoint, int> GetColorFunc(int x0, int x1, int y1)

Parameters

x0 int
x1 int
y1 int

Returns

Func<TPoint, int>

GetCustomGrid()

protected IGrid<MeshCell, TPoint> GetCustomGrid()

Returns

IGrid<MeshCell, TPoint>

GetCustomMap()

protected WindowedMap<TPoint> GetCustomMap()

Returns

WindowedMap<TPoint>

GetCustomMap3D()

protected IMap3D<TPoint> GetCustomMap3D()

Returns

IMap3D<TPoint>

GetCustomMeshMap()

protected IMeshMap<TPoint> GetCustomMeshMap()

Returns

IMeshMap<TPoint>

InitGrid()

protected abstract void InitGrid()

Start()

public void Start()

Update()

public void Update()

UpdateUVs()

public void UpdateUVs()

__UpdatePresentation(bool)

public void __UpdatePresentation(bool forceUpdate)

Parameters

forceUpdate bool