private void Snap(float angle, bool forcePosition) { if (angularJoint != null) { angularJoint.SetTarget(angle); } else if (forcePosition) { joint.ApplyXAngle(invInitialLocalRotation, angle); } else { joint.SetXAngleTarget(angle); } }
protected override void SetJoint(float pos, float spring, float damper) { joint.SetXAngleTarget(pos); JointDrive angularXDrive = joint.angularXDrive; angularXDrive.positionSpring = spring; angularXDrive.positionDamper = damper; joint.angularXDrive = angularXDrive; if (SignalManager.skipTransitions) { joint.ApplyXAngle(invInitialLocalRotation, pos); } else { body.WakeUp(); } }