Class UITextCell
This component represents a cell that can be used with Unity's GUI system, using a Text component to render the cell.
It expects a Text component in the hierarchy (on the same game object or a child).
To use it with grid builders: Make a new cell prefab with this component Add the grid builder to the canvas or to some child of the canvas Set the cell prefab property oof the grid builder to the new prefab.
Grids ships with a few example prefabs that uses UITextCells; check them out to
see how they work.
[Version(1, 10, 0)]
public class UITextCell : TileCell, IColorableCell, ICell
- Inheritance
-
UITextCell
- Implements
- 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
Properties
Color
The main color of the tile.
This is used to set the color of tiles dynamically.
public override Color Color { get; set; }
Property Value
Dimensions
The 2D dimensions of the tile. For 3D objects, this is the dimensions along the same plane as the 2D grid.
public override Vector2 Dimensions { get; }
Property Value
Text
public string Text { get; set; }
Property Value
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 override void AddAngle(float angle)
Parameters
angle
float
SetAngle(float)
Sets the angle of the tile. If the tile is in the XY plane, the angle will be the Z angle.
public override void SetAngle(float angle)
Parameters
angle
floatIn 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 override void __UpdatePresentation(bool forceUpdate)
Parameters
forceUpdate
bool