Skip to content

Hooks.Random

Mariusz edited this page Feb 12, 2020 · 3 revisions

Hooks' Random nested class contains all utility methods based on Randomness.

Public Methods

T RandomItem<T>(IEnumerable<T>)

Returns a random item from a collection.

Vector2 Range(Vector2, Vector2)

Returns a Vector2 with all of it's values randomized; Clamped between the two given vectors.

Vector3 Range(Vector3, Vector3)

Returns a Vector3 with all of it's values randomized; Clamped between the two given vectors.

List<T> Shuffle<T>(List<T>)

Shuffles the list.

Public Fields/Properties/Constants

Vector3 RandomVector01 (get-only)

Returns a Vector3 with all of it's values being a random value between 0f and 1f.

Vector3 RandomVector01WithNeg (get-only)

Returns a Vector3 with all of it's values being a random value between -1f and 1f.