NodeWorld

Random

La référence est en anglais : elle est générée à partir des commentaires du code, écrits en anglais.

csharp
public static class Random

Namespace NodeWorld.Flux.

Random numbers as Unity's Random: one sequence for the world, which InitState makes the same for every player who uses the same seed (shows played in sync).

Properties

value

csharp
public static float value { get; }

0 .. 1, both included.

insideUnitSphere

csharp
public static Vector3 insideUnitSphere { get; }

A random point inside a sphere of radius 1.

onUnitSphere

csharp
public static Vector3 onUnitSphere { get; }

A random point on a sphere of radius 1.

insideUnitCircle

csharp
public static Vector2 insideUnitCircle { get; }

A random point inside a circle of radius 1.

rotation

csharp
public static Quaternion rotation { get; }

A random rotation.

Methods

InitState

csharp
public static void InitState(int seed)

Starts the world's sequence from seed: every player who uses the same seed draws the same numbers.

Range

csharp
public static float Range(float min, float max)

min .. max, both included.

csharp
public static int Range(int min, int max)

min .. max - 1 (max excluded), min when max <= min.