Class TesseraTile
GameObjects with this behaviour record adjacency information for use with a TesseraGenerator.
Namespace: Tessera
Assembly: cs.temp.dll.dll
Syntax
public class TesseraTile : MonoBehaviour
Fields
center
Where the center of tile is. For big tils that occupy more than one cell, it's the center of the cell with offset (0, 0, 0).
Declaration
public Vector3 center
Field Value
Type | Description |
---|---|
Vector3 |
faceDetails
A list of outward facing faces. For a normal cube tile, there are 6 faces. Each face contains adjacency information that indicates what other tiles can connect to it. It is recommended you only edit this via the Unity Editor, or Get(Vector3Int, FaceDir) and AddOffset(Vector3Int)
Declaration
public List<OrientedFace> faceDetails
Field Value
Type | Description |
---|---|
List<OrientedFace> |
instantiateChildrenOnly
If set, when being instantiated by a Generator, only children will get constructed. If there are no children, then this effectively disables the tile from instantiation.
Declaration
public bool instantiateChildrenOnly
Field Value
Type | Description |
---|---|
Boolean |
offsets
A list of cells that this tile occupies. For a normal cube tile, this just contains Vector3Int.zero, but it will be more for "big" tiles. It is recommended you only edit this via the Unity Editor, or AddOffset(Vector3Int) and RemoveOffset(Vector3Int)
Declaration
public List<Vector3Int> offsets
Field Value
Type | Description |
---|---|
List<Vector3Int> |
reflectable
If true, when generating, reflections in the x-axis will be used.
Declaration
public bool reflectable
Field Value
Type | Description |
---|---|
Boolean |
rotatable
If true, when generating, all 4 rotations of the tile will be used.
Declaration
public bool rotatable
Field Value
Type | Description |
---|---|
Boolean |
tileSize
The size of one cell in the tile. NB: This field is only used in the Editor - you must set tileSize to match.
Declaration
public Vector3 tileSize
Field Value
Type | Description |
---|---|
Vector3 |
Methods
AddOffset(Vector3Int)
Configures the tile as a "big" tile that occupies several cells. Keeps offsets and faceDetails in sync.
Declaration
public void AddOffset(Vector3Int o)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | o |
Get(Vector3Int, FaceDir)
Finds the face details for a cell with a given offeset.
Declaration
public FaceDetails Get(Vector3Int offset, FaceDir faceDir)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | offset | |
FaceDir | faceDir |
Returns
Type | Description |
---|---|
FaceDetails |
RemoveOffset(Vector3Int)
Configures the tile as a "big" tile that occupies several cells. Keeps offsets and faceDetails in sync.
Declaration
public void RemoveOffset(Vector3Int o)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | o |