All Classes Namespaces Functions Variables Enumerations Enumerator Properties
plyCommon.plyExtensions Class Reference

Various extensions. More...

Static Public Member Functions

static string RGBToHex (this Color color)
 A Color extension method that converts a Unity Color to a hexadecimal string. More...
 
static Color HexToRGB (this Color color, string hex)
 A Color extension method that converts a hexadecimal string to a Unity Color. More...
 
static RaycastHit[] Sort (this RaycastHit[] hits)
 A RaycastHit[] extension method that sorts the given array according to distance from closest to furthest. More...
 
static bool HasLayer (this LayerMask mask, int layer)
 A LayerMask extension method that query if 'mask' has layer. More...
 
static int GetFirstSetLayer (this LayerMask mask)
 A LayerMask extension method that gets the first layer that is present in the mask. More...
 
static LayerMask IncludeLayer (this LayerMask mask, int layer)
 A LayerMask extension method that includes a layer in the mask. More...
 
static LayerMask RemoveLayer (this LayerMask mask, int layer)
 A LayerMask extension method that removes a layer from the mask. More...
 
static LayerMask ToggleLayer (this LayerMask mask, int layer)
 A LayerMask extension method that toggle a layer in the mask. More...
 
static Transform GetFirstChildWithTag (this Transform parent, string tag)
 

Detailed Description

Various extensions.

Member Function Documentation

static int plyCommon.plyExtensions.GetFirstSetLayer ( this LayerMask  mask)
static

A LayerMask extension method that gets the first layer that is present in the mask.

Parameters
maskThe mask to act on.
Returns
The first found layer.
static bool plyCommon.plyExtensions.HasLayer ( this LayerMask  mask,
int  layer 
)
static

A LayerMask extension method that query if 'mask' has layer.

Parameters
maskThe mask to act on.
layerThe layer to check.
Returns
true if layer is in the mask, false if not.
static Color plyCommon.plyExtensions.HexToRGB ( this Color  color,
string  hex 
)
static

A Color extension method that converts a hexadecimal string to a Unity Color.

Parameters
colorThe color to act on.
hexThe hexadecimal colour value.
Returns
A Color.
static LayerMask plyCommon.plyExtensions.IncludeLayer ( this LayerMask  mask,
int  layer 
)
static

A LayerMask extension method that includes a layer in the mask.

Parameters
maskThe mask to act on.
layerThe layer to add.
Returns
The modified LayerMask.
static LayerMask plyCommon.plyExtensions.RemoveLayer ( this LayerMask  mask,
int  layer 
)
static

A LayerMask extension method that removes a layer from the mask.

Parameters
maskThe mask to act on.
layerThe layer to remove.
Returns
The modified LayerMask.
static string plyCommon.plyExtensions.RGBToHex ( this Color  color)
static

A Color extension method that converts a Unity Color to a hexadecimal string.

Parameters
colorThe color to act on.
Returns
A string representation of the hexadecimal value.
static RaycastHit [] plyCommon.plyExtensions.Sort ( this RaycastHit[]  hits)
static

A RaycastHit[] extension method that sorts the given array according to distance from closest to furthest.

Parameters
hitsThe hits list act on.
static LayerMask plyCommon.plyExtensions.ToggleLayer ( this LayerMask  mask,
int  layer 
)
static

A LayerMask extension method that toggle a layer in the mask.

Parameters
maskThe mask to act on.
layerThe layer to toggle.
Returns
The modified LayerMask.