JointDrive.positionSpring 弹簧位置
var positionSpring : float
Description描述
Strength of a rubber-band pull toward the defined direction. Only used if mode includes Position.
一个橡皮筋强度拉向所定义的方向。只用于如果mode包含Position。
public class example : MonoBehaviour {
void Start() {
ConfigurableJoint joint = gameObject.AddComponent<ConfigurableJoint>();
joint.targetPosition = new Vector3(0, 0, -10);
JointDrive drive = new JointDrive();
drive.mode = JointDriveMode.Position;
drive.positionSpring = 20;
joint.zDrive = drive;
}
}
// Create a JointDrive, configure it and assign the JointDrive to
// the zDrive element of a configurable joint.
//创建一个关节驱动,配置它并指定关节驱动到一个可配置关节的zDrive元素
function Start() {
var joint : ConfigurableJoint = gameObject.AddComponent(ConfigurableJoint);
joint.targetPosition = Vector3(0,0,-10);
var drive : JointDrive = JointDrive();
drive.mode = JointDriveMode.Position;
drive.positionSpring = 20;
joint.zDrive = drive;
}
最后修改:2011年1月27日 Thursday 21:29