Version: 2017.2
public static float value ;

描述

返回介于 0.0 [含] 与 1.0 [含] 之间的随机数(只读)。

此属性可能会返回 0.0 和 1.0。此行为与许多其他随机数生成器的行为不同,它们返回的值小于 1.0,但从不完全等于 1.0。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { Color RandomColor() { return new Color(Random.value, Random.value, Random.value); } }