static var gravity : Vector3
Description描述
The gravity applied to all rigid bodies in the scene.
场景中应用到所有刚性物体的重力。
Gravity can be turned off for an individual rigidbody using its useGravity property.
useGravity 方法可以用来对场景中的每一个刚性物体设置是否受重力作用。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Awake() {
Physics.gravity = new Vector3(0, -1.0F, 0);
}
}
Physics.gravity = Vector3(0, -1.0, 0);