mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-17 18:40:33 +00:00
Added Rigidbody Extensions for backwards compatibility
This commit is contained in:
parent
d635aa68dd
commit
4f699be7d4
@ -108,5 +108,40 @@ public static void GetPositionAndRotation(this Transform transform, out Vector3
|
||||
rotation = transform.rotation;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !UNITY_6000_0_OR_NEWER
|
||||
// Rigidbody velocity was renamed to linearVelocity in Unity 6.0.0
|
||||
public static Vector3 linearVelocity(this Rigidbody rb)
|
||||
{
|
||||
return rb.velocity;
|
||||
}
|
||||
|
||||
public static void linearVelocity(this Rigidbody rb, Vector3 value)
|
||||
{
|
||||
rb.velocity = value;
|
||||
}
|
||||
|
||||
// Rigidbody drag was renamed to linearDamping in Unity 6.0.0
|
||||
public static float linearDamping(this Rigidbody rb)
|
||||
{
|
||||
return rb.drag;
|
||||
}
|
||||
|
||||
public static void linearDamping(this Rigidbody rb, float value)
|
||||
{
|
||||
rb.drag = value;
|
||||
}
|
||||
|
||||
// Rigidbody angularDrag was renamed to angularDamping in Unity 6.0.0
|
||||
public static float angularDamping(this Rigidbody rb)
|
||||
{
|
||||
return rb.angularDrag;
|
||||
}
|
||||
|
||||
public static void angularDamping(this Rigidbody rb, float value)
|
||||
{
|
||||
rb.angularDrag = value;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user