Physics.gravity 重力

static var gravity : Vector3


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);
Page last updated: 2011-4-9