protected void ShowControls()
{
if (this.m_TransformSyncMode == null)
{
this.m_Initialized = false;
}
this.Init();
base.serializedObject.Update();
int num = 0;
if (this.m_NetworkSendIntervalProperty.floatValue != 0f)
{
num = (int) (1f / this.m_NetworkSendIntervalProperty.floatValue);
}
int num2 = EditorGUILayout.IntSlider(this.m_NetworkSendIntervalLabel, num, 0, 30, new GUILayoutOption[0]);
if (num2 != num)
{
if (num2 == 0)
{
this.m_NetworkSendIntervalProperty.floatValue = 0f;
}
else
{
this.m_NetworkSendIntervalProperty.floatValue = 1f / ((float) num2);
}
}
EditorGUILayout.PropertyField(this.m_TransformSyncMode, new GUILayoutOption[0]);
if ((this.m_TransformSyncMode.enumValueIndex == 3) && (this.m_SyncTransform.GetComponent<Rigidbody>() == null))
{
Debug.LogError("Object has no Rigidbody component.");
this.m_TransformSyncMode.enumValueIndex = 1;
EditorUtility.SetDirty(this.m_SyncTransform);
}
if ((this.m_TransformSyncMode.enumValueIndex == 2) && (this.m_SyncTransform.GetComponent<Rigidbody2D>() == null))
{
Debug.LogError("Object has no Rigidbody2D component.");
this.m_TransformSyncMode.enumValueIndex = 1;
EditorUtility.SetDirty(this.m_SyncTransform);
}
if ((this.m_TransformSyncMode.enumValueIndex == 4) && (this.m_SyncTransform.GetComponent<CharacterController>() == null))
{
Debug.LogError("Object has no CharacterController component.");
this.m_TransformSyncMode.enumValueIndex = 1;
EditorUtility.SetDirty(this.m_SyncTransform);
}
EditorGUILayout.LabelField("Movement:", new GUILayoutOption[0]);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(this.m_MovementTheshold, this.m_MovementThesholdLabel, new GUILayoutOption[0]);
if (this.m_MovementTheshold.floatValue < 0f)
{
this.m_MovementTheshold.floatValue = 0f;
EditorUtility.SetDirty(this.m_SyncTransform);
}
EditorGUILayout.PropertyField(this.m_SnapThreshold, this.m_SnapThresholdLabel, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_InterpolateMovement, this.m_InterpolateMovementLabel, new GUILayoutOption[0]);
EditorGUI.indentLevel--;
EditorGUILayout.LabelField("Rotation:", new GUILayoutOption[0]);
EditorGUI.indentLevel++;
int num3 = EditorGUILayout.Popup("Rotation Axis", (int) this.m_SyncTransform.syncRotationAxis, axisOptions, new GUILayoutOption[0]);
if (num3 != this.m_SyncTransform.syncRotationAxis)
{
this.m_SyncTransform.syncRotationAxis = (NetworkTransform.AxisSyncMode) num3;
EditorUtility.SetDirty(this.m_SyncTransform);
}
EditorGUILayout.PropertyField(this.m_InterpolateRotation, this.m_InterpolateRotationLabel, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_RotationSyncCompression, this.m_RotationSyncCompressionLabel, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_SyncSpin, this.m_SyncSpinLabel, new GUILayoutOption[0]);
EditorGUI.indentLevel--;
base.serializedObject.ApplyModifiedProperties();
}
}