JUtils
A unity utilities library
|
A struct with a custom editor which can be used to get a minimum and a maximum value, handy for random values & clamping More...
Public Member Functions | |
MinMaxInt (int min, int max) | |
Create a new MinMax instance More... | |
int | Random () |
Get a random value from min to max using UnityEngine.Random More... | |
int | Random (Random random) |
Get a ranbdom value from min to max using System.Random More... | |
bool | Contains (int value) |
Check if the value is contained between min and max More... | |
int | Clamp (int value) |
Clamps the value to be between A and B More... | |
float | Lerp (float time) |
Lerp from min to max More... | |
float | InverseLerp (float value) |
inverse lerp from min to max More... | |
Properties | |
int | min [get] |
Get the min value More... | |
int | max [get] |
Get the max value More... | |
int | range [get] |
Returns _max - _min More... | |
A struct with a custom editor which can be used to get a minimum and a maximum value, handy for random values & clamping
|
inline |
Create a new MinMax instance
min | |
max |
References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.
|
inline |
Clamps the value to be between A and B
value |
References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.
|
inline |
Check if the value is contained between min and max
References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.
|
inline |
inverse lerp from min to max
References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.
|
inline |
Lerp from min to max
References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.
|
inline |
Get a random value from min to max using UnityEngine.Random
|
inline |
Get a ranbdom value from min to max using System.Random
|
get |
Get the max value
|
get |
Get the min value
|
get |
Returns _max - _min