<aside>

Overview


Randomly is a comprehensive and easy-to-use random data generation library for Unity.

Important! The plugin uses the Xoshiro256 algorithm and always includes the maximum value!**

</aside>

<aside>

Randomly.


using PahutyakV.Randomly;

// Random int value
int i = Randomly.Int(0, 2);

//Random bool value with a probability to be true (0-1)
bool b = Randomly.Bool(0.75f)

</aside>

<aside>

Randomly.Collection


Provides advanced random selection and shuffling utilities for collections. Supports equal probability selection, weighted selection, and selection with animation curves.

Choice Methods:

Take Methods:

Shuffle Methods:

Usage Notes:

// Get random list element
List<int> myList = new List<int>() { 4, 7, 2, 8, 12 };
int v = Randomly.Collection.Choice(myList);

// Get random 2 list elements from WeightedList
List<int> values = myWeightedList.Take(2);

</aside>

<aside>

Randomly.DateTime


Provides random date, time, and day utilities.

Date Methods:

Day Methods:

Time Methods:

// Random future date within next 60 days
DateTime future = Randomly.DateTime.DateFuture(60);

// Random time of day
TimeSpan time = Randomly.DateTime.TimeOfDay();

</aside>

<aside>

Randomly.Spatial


Provides random spatial values: vectors, quaternions, directions, and points inside/outside geometric shapes.

Vector Methods:

Quaternion Methods:

Spatial Methods:

// Random Vector2
Vector2 v2 = Randomly.Spatial.Vector2(0f, 10f);

// Random Quaternion
Quaternion rotation = Randomly.Spatial.Rotation();

</aside>

<aside>

Randomly.Color


Provides random Color generation for Unity, supporting tones, ranges, and string/byte representations.

Color Generation Methods:

String / RGB(A) Methods:

// Random warm color
Color warmColor = Randomly.Color.Get(RandomlyColor.ColorTone.Warm);

// Random hex color
string hexColor = Randomly.Color.Hex();

</aside>

<aside>

Randomly.Noise


Provides Perlin and Value noise generation for 1D, 2D, 3D spaces with optional fractal details.

Perlin Noise Methods:

Value Noise Methods:

// Generate 2D Perlin noise
float noiseValue = Randomly.Noise.Perlin2D(3.5f, 7.2f);

// Generate fractal Perlin noise
float fractalNoise = Randomly.Noise.FractalPerlin2D(1.0f, 2.0f, octaves: 4, persistence: 0.5f, lacunarity: 2f);

</aside>

<aside>

</aside>

<aside>

</aside>

<aside>

</aside>