Random.onUnitSphere

Switch to Manual
public static Vector3 onUnitSphere ;

Description

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

using UnityEngine;
using System.Collections;

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