ReticleSide
An enum that the generator uses to differentiate between sides of the reticle. For line crosshairs each side refers to an individual line. For circle crosshairs each side refers to a quarter of the circle. This enum can work as a mask, so you can use it to specify multiple sides.
Values
Value | Description |
---|---|
TOP | The top of the crosshair. |
RIGHT | The right side of the crosshair. |
BOTTOM | The bottom side of the crosshair. |
LEFT | The left side of the crosshair. |
Extension methods
ReticleSide
includes extension methods that provide useful functionality for working with the enum.
Next
Gets the next side of the reticle.
Returns
Type | Description |
---|---|
ReticleSide | The next side of the reticle. For example, ReticleSide.TOP.Next() returns ReticleSide.RIGHT . |
Horizontal
Indicates whether the side is horizontal.
Returns
Type | Description |
---|---|
bool | true if the side is either ReticleSide.RIGHT or ReticleSide.LEFT . Otherwise, returns false . |
Vertical
Indicates whether the side is vertical.
Returns
Type | Description |
---|---|
bool | true if the side is either ReticleSide.TOP or ReticleSide.BOTTOM . Otherwise, returns false . |
AsIndex
Gets the side of the reticle as an index. The dynamic line crosshair uses this to help return the RectTransform associated with each crosshair side.
Returns
Type | Description |
---|---|
int | The side of the reticle as an index. For example, ReticleSide.TOP.AsIndex() returns 0 . |
Toggle
Toggles on or off a side in a ReticleSide
mask.
Parameters
Name | Type | Description |
---|---|---|
toggle | ReticleSide | The side to toggle. |
Returns
Type | Description |
---|---|
ReticleSide | The mask with the side toggled. |