A* Pathfinding Project
4.3.2
The A* Pathfinding Project for Unity 3D
|
Utility functions for working with numbers and strings. More...
Utility functions for working with numbers and strings.
Static Public Member Functions | |
static string | FormatBytesBinary (int bytes) |
Returns a nicely formatted string for the number of bytes (KiB, MiB, GiB etc). More... | |
static Color | HSVToRGB (float h, float s, float v) |
Converts an HSV color to an RGB color. More... | |
static Color | IntToColor (int i, float a) |
Returns a nice color from int i with alpha a. More... | |
static float | MapTo (float startMin, float startMax, float targetMin, float targetMax, float value) |
Maps a value between startMin and startMax to be between targetMin and targetMax. More... | |
Static Private Member Functions | |
static int | Bit (int a, int b) |
Returns bit number b from int a. More... | |
|
staticprivate |
Returns bit number b from int a.
The bit number is zero based. Relevant b values are from 0 to 31. Equals to (a >> b) & 1
|
static |
Returns a nicely formatted string for the number of bytes (KiB, MiB, GiB etc).
Uses decimal names (KB, Mb - 1000) but calculates using binary values (KiB, MiB - 1024)
|
static |
Converts an HSV color to an RGB color.
According to the algorithm described at http://en.wikipedia.org/wiki/HSL_and_HSV
|
static |
Returns a nice color from int i with alpha a.
Got code from the open-source Recast project, works really well. Seems like there are only 64 possible colors from studying the code
|
static |
Maps a value between startMin and startMax to be between targetMin and targetMax.