Class MeshGridBuilder<TPoint>
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.runInEditModeComponent.GetComponent<T>()Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentsInParent<T>()Component.transformComponent.gameObjectComponent.tagObject.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.nameObject.hideFlags
- Extension Methods
Fields
CenterRect
protected readonly Rect CenterRect
Field Value
alignment
[SerializeField]
[Tooltip("How the anchor of the grid lies relative to the grid.")]
protected MapAlignment alignment
Field Value
cellDimensions
public Vector2 cellDimensions
Field Value
cellSpacingFactor
[SerializeField]
[Tooltip("A factor that controls the spacing between cells.")]
protected Vector2 cellSpacingFactor
Field Value
cells
[SerializeField]
protected MeshCell[] cells
Field Value
- MeshCell[]
colorFunction
[SerializeField]
[Tooltip("The color function to use to color cells.")]
protected ColorFunction colorFunction
Field Value
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
grid
protected IGrid<MeshCell, TPoint> grid
Field Value
isInteractive
[SerializeField]
[Tooltip("Whether the grid will respond to mouse clicks")]
protected bool isInteractive
Field Value
meshMap
protected IMeshMap<TPoint> meshMap
Field Value
- IMeshMap<TPoint>
size
[SerializeField]
[Tooltip("The size of your shape (in cells).")]
protected int size
Field Value
textureHeight
public int textureHeight
Field Value
textureWidth
public int textureWidth
Field Value
updateType
[SerializeField]
[Tooltip("When to update the grid")]
protected UpdateType updateType
Field Value
useColor
[SerializeField]
[Tooltip("Whether to set cells colors")]
protected bool useColor
Field Value
Properties
Alignment
public MapAlignment Alignment { get; set; }
Property Value
CellSpacingFactor
public Vector2 CellSpacingFactor { get; set; }
Property Value
ColorFunction
public ColorFunction ColorFunction { get; set; }
Property Value
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
Grid
Returns the grid built with this builder.
public IGrid<MeshCell, TPoint> Grid { get; protected set; }
Property Value
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
UseColor
public bool UseColor { get; set; }
Property Value
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
Returns
GetCustomGrid()
protected IGrid<MeshCell, TPoint> GetCustomGrid()
Returns
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