From 4fee160b6c14bf9243fc07ece183a2c37633a5f6 Mon Sep 17 00:00:00 2001 From: MichalPetryka <35800402+MichalPetryka@users.noreply.github.com> Date: Wed, 2 Jan 2019 17:29:34 +0100 Subject: [PATCH] NetworkTransportChild - ?: (#209) --- Mirror/Runtime/NetworkTransformChild.cs | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/Mirror/Runtime/NetworkTransformChild.cs b/Mirror/Runtime/NetworkTransformChild.cs index 1782e4c9a..cc4b29e41 100644 --- a/Mirror/Runtime/NetworkTransformChild.cs +++ b/Mirror/Runtime/NetworkTransformChild.cs @@ -298,23 +298,13 @@ void FixedUpdateClient() // interpolate on client if (m_LastClientSyncTime != 0) { - if (m_InterpolateMovement > 0) - { - m_Target.localPosition = Vector3.Lerp(m_Target.localPosition, m_TargetSyncPosition, m_InterpolateMovement); - } - else - { - m_Target.localPosition = m_TargetSyncPosition; - } + m_Target.localPosition = m_InterpolateMovement > 0 + ? Vector3.Lerp(m_Target.localPosition, m_TargetSyncPosition, m_InterpolateMovement) + : m_TargetSyncPosition; - if (m_InterpolateRotation > 0) - { - m_Target.localRotation = Quaternion.Slerp(m_Target.localRotation, m_TargetSyncRotation3D, m_InterpolateRotation); - } - else - { - m_Target.localRotation = m_TargetSyncRotation3D; - } + m_Target.localRotation = m_InterpolateRotation > 0 + ? Quaternion.Slerp(m_Target.localRotation, m_TargetSyncRotation3D, m_InterpolateRotation) + : m_TargetSyncRotation3D; } }