protected override void ImportJointData(Joint joint) { #if UNITY_2020_1_OR_NEWER AdjustMovement(joint); if (joint.dynamics != null) { unityJoint.linearDamping = (float)joint.dynamics.damping; unityJoint.jointFriction = (float)joint.dynamics.friction; } else { unityJoint.angularDamping = 0; unityJoint.jointFriction = 0; } #else ArticulationBody prismaticJoint = (ArticulationBody)unityJoint; prismaticJoint.axis = (joint.axis != null) ? GetAxis(joint.axis) : GetDefaultAxis(); if (joint.dynamics != null) { prismaticJoint.xDrive = GetJointDrive(joint.dynamics); } if (joint.limit != null) { PrismaticJointLimitsManager prismaticLimits = GetComponent <PrismaticJointLimitsManager>(); prismaticLimits.InitializeLimits(joint.limit); } #endif }
protected override void ImportJointData(Joint joint) { ConfigurableJoint prismaticJoint = (ConfigurableJoint) UnityJoint; prismaticJoint.axis = (joint.axis != null) ? GetAxis(joint.axis) : GetDefaultAxis(); if (joint.dynamics != null) prismaticJoint.xDrive = GetJointDrive(joint.dynamics); if (joint.limit != null) { PrismaticJointLimitsManager prismaticLimits = GetComponent<PrismaticJointLimitsManager>(); prismaticLimits.InitializeLimits(joint.limit); } }