ReticleSideUtility
Provides methods to help you work with dynamic line crosshairs.
Static methods
ForEach
Iterates through each ReticleSide value and processes the passed in action for each side.
Parameters
Name | Type | Description |
---|---|---|
action | Action<ReticleSide> | The action to process for each ReticleSide value. |
Example
The following example uses the ForEach
method to iterate through each side of the reticle and set its color.
private void ColorCrosshairReticle(ReticleLines reticle, Color color)
{
ReticleSideUtility.ForEach((ReticleSide line) =>
{
reticle[line].GetComponent<Image>().color = color;
});
}