Extensions
An extension methods for Unity
Array
int[] data = { 0, 1, 2, 3, 4, 5 };
// swap 2 elements in array
data.SwapElements(2, 5); // output 0, 1, 5, 3, 4, 2Bounds
// get random point in Bounds object
Vector3 randomPoint = myBound.RandomPoint();byte
byte b = 16;
// convert to volume formatted string
var size = b.SizeSuffix(2) // size = "16 bytes"
// convert to Currency formatted string
var amount = b.CurrencySuffix(2) // amount = "16"Color
DateTime
Dictionary
float
IEnumerable
int
LayerMask
long
Mathmatics.float2
Mathmatics.float3
Mathmatics.float4
Mathematics.quaternion
Quaternion
RectTransform
short
string
Texture2D
Transform
Vector2
Vector2Int
Vector3
Vector3Int
Vector4
Last updated