@@ -43,7 +43,7 @@ public class NetworkTransformEditor : NetcodeEditorBase<NetworkTransform>
4343 private SerializedProperty m_AuthorityMode ;
4444
4545 private static int s_ToggleOffset = 45 ;
46- private static int s_IndentOffset = 15 ;
46+
4747 private static float s_MaxRowWidth = EditorGUIUtility . labelWidth + EditorGUIUtility . fieldWidth + 5 ;
4848 private static GUIContent s_PositionLabel = EditorGUIUtility . TrTextContent ( "Position" ) ;
4949 private static GUIContent s_RotationLabel = EditorGUIUtility . TrTextContent ( "Rotation" ) ;
@@ -192,30 +192,30 @@ private void DisplayNetworkTransformProperties()
192192 {
193193 if ( networkTransform . SynchronizePosition )
194194 {
195- DrawIndentedPropertyField ( 1 , m_PositionInterpolationTypeProperty ) ;
195+ DrawIndentedPropertyField ( m_PositionInterpolationTypeProperty , 1 ) ;
196196 // Only display when using Lerp.
197197 if ( networkTransform . PositionInterpolationType == NetworkTransform . InterpolationTypes . Lerp )
198198 {
199- DrawIndentedPropertyField ( 2 , m_SlerpPosition ) ;
200- DrawIndentedPropertyField ( 2 , m_PositionMaximumInterpolationTimeProperty ) ;
199+ DrawIndentedPropertyField ( m_SlerpPosition , 2 ) ;
200+ DrawIndentedPropertyField ( m_PositionMaximumInterpolationTimeProperty , 2 ) ;
201201 }
202202 }
203203 if ( networkTransform . SynchronizeRotation )
204204 {
205- DrawIndentedPropertyField ( 1 , m_RotationInterpolationTypeProperty ) ;
205+ DrawIndentedPropertyField ( m_RotationInterpolationTypeProperty , 1 ) ;
206206 // Only display when using Lerp.
207207 if ( networkTransform . RotationInterpolationType == NetworkTransform . InterpolationTypes . Lerp )
208208 {
209- DrawIndentedPropertyField ( 2 , m_RotationMaximumInterpolationTimeProperty ) ;
209+ DrawIndentedPropertyField ( m_RotationMaximumInterpolationTimeProperty , 2 ) ;
210210 }
211211 }
212212 if ( networkTransform . SynchronizeScale )
213213 {
214- DrawIndentedPropertyField ( 1 , m_ScaleInterpolationTypeProperty ) ;
214+ DrawIndentedPropertyField ( m_ScaleInterpolationTypeProperty , 1 ) ;
215215 // Only display when using Lerp.
216216 if ( networkTransform . ScaleInterpolationType == NetworkTransform . InterpolationTypes . Lerp )
217217 {
218- DrawIndentedPropertyField ( 2 , m_ScaleMaximumInterpolationTimeProperty ) ;
218+ DrawIndentedPropertyField ( m_ScaleMaximumInterpolationTimeProperty , 2 ) ;
219219 }
220220 }
221221 }
@@ -250,17 +250,6 @@ private void DisplayNetworkTransformProperties()
250250#endif // COM_UNITY_MODULES_PHYSICS2D
251251 }
252252
253- private void DrawIndentedPropertyField ( int indentLevel , SerializedProperty property )
254- {
255- var originalWidth = EditorGUIUtility . labelWidth ;
256- EditorGUIUtility . labelWidth = originalWidth - ( indentLevel * s_IndentOffset ) - 2 ;
257- EditorGUILayout . BeginHorizontal ( ) ;
258- EditorGUILayout . Space ( indentLevel * s_IndentOffset , false ) ;
259- EditorGUILayout . PropertyField ( property , GUILayout . ExpandWidth ( true ) ) ;
260- EditorGUILayout . EndHorizontal ( ) ;
261- EditorGUIUtility . labelWidth = originalWidth ;
262- }
263-
264253 /// <inheritdoc/>
265254 public override void OnInspectorGUI ( )
266255 {
0 commit comments