Version: 2017.1

Random.onUnitSphere

切换到手册
public static Vector3 onUnitSphere ;

描述

返回半径为 1 的球体表面上的随机点(只读)。

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Example() { GetComponent<Rigidbody>().velocity = Random.onUnitSphere * 10; } }