JUtils
A unity utilities library
JUtils.MinMaxInt Struct Reference

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...
 

Detailed Description

A struct with a custom editor which can be used to get a minimum and a maximum value, handy for random values & clamping

Constructor & Destructor Documentation

◆ MinMaxInt()

JUtils.MinMaxInt.MinMaxInt ( int  min,
int  max 
)
inline

Create a new MinMax instance

Parameters
min
max

References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.

Member Function Documentation

◆ Clamp()

int JUtils.MinMaxInt.Clamp ( int  value)
inline

Clamps the value to be between A and B

Parameters
value
Returns

References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.

◆ Contains()

bool JUtils.MinMaxInt.Contains ( int  value)
inline

Check if the value is contained between min and max

References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.

◆ InverseLerp()

float JUtils.MinMaxInt.InverseLerp ( float  value)
inline

inverse lerp from min to max

References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.

◆ Lerp()

float JUtils.MinMaxInt.Lerp ( float  time)
inline

Lerp from min to max

References JUtils.MinMaxInt.max, and JUtils.MinMaxInt.min.

◆ Random() [1/2]

int JUtils.MinMaxInt.Random ( )
inline

Get a random value from min to max using UnityEngine.Random

Returns

◆ Random() [2/2]

int JUtils.MinMaxInt.Random ( Random  random)
inline

Get a ranbdom value from min to max using System.Random

Property Documentation

◆ max

int JUtils.MinMaxInt.max
get

Get the max value

◆ min

int JUtils.MinMaxInt.min
get

Get the min value

◆ range

int JUtils.MinMaxInt.range
get

Returns _max - _min


The documentation for this struct was generated from the following file: