Physics物理学
- bounceThreshold
- CapsuleCastAll
- CapsuleCast
- CheckCapsule
- CheckSphere
- GetIgnoreLayerCollision
- gravity
- IgnoreCollision
- IgnoreLayerCollision
- Linecast
- maxAngularVelocity
- minPenetrationForPenalty
- OverlapSphere
- RaycastAll
- Raycast
- sleepAngularVelocity
- sleepVelocity
- solverIterationCount
- SphereCastAll
- SphereCast
Physics.gravity 重力
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);
最后修改:2011年4月9日 Saturday 9:28