Scripting API

Table of Contents

Input reference

if (Input.anyKey)
    Debug.Log("A key or mouse click has been detected");

Application reference

// Many other runtime informations

Time reference

Random reference

// min [inclusive] and max [inclusive]
public static float Range(float min, float max);

// 0.0 [inclusive] and 1.0 [inclusive]
public static float value;

public static Quaternion rotation;

public static Vector2 insideUnitCircle;

// Many other overloadings
public static Color ColorHSV();

PlayerPrefs vs EditorPrefs discussion

float PingPong(float t, float length) reference

// PingPongs the value t, so that it is never larger than length and never smaller than 0.
// The returned value will move back and forth between 0 and length.
public static float PingPong(float t, float length);