Skip to main content

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

ValueDescription
TOPThe top of the crosshair.
RIGHTThe right side of the crosshair.
BOTTOMThe bottom side of the crosshair.
LEFTThe 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

TypeDescription
ReticleSideThe next side of the reticle. For example, ReticleSide.TOP.Next() returns ReticleSide.RIGHT.

Horizontal

Indicates whether the side is horizontal.

Returns

TypeDescription
booltrue if the side is either ReticleSide.RIGHT or ReticleSide.LEFT. Otherwise, returns false.

Vertical

Indicates whether the side is vertical.

Returns

TypeDescription
booltrue 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

TypeDescription
intThe 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

NameTypeDescription
toggleReticleSideThe side to toggle.

Returns

TypeDescription
ReticleSideThe mask with the side toggled.