一,同时施加多个限制:
用按位或(bitwise OR)实现,例如:
GetComponent<Rigidbody>().constraints=RigidbodyConstraints.FreezeRotation
|RigidbodyConstraints.FreezePositionX
|RigidbodyConstraints.FreezePositionZ;
二,去掉所有限制:
GetComponent<Rigidbody>().constraints=RigidbodyConstraints.None;
原文:http://www.cnblogs.com/wantnon/p/4543041.html