public void Init()
{
if (!this.m_Initialized)
{
this.m_Initialized = true;
this.m_SyncTransform = base.target as NetworkTransform;
if (this.m_SyncTransform.transformSyncMode == NetworkTransform.TransformSyncMode.SyncNone)
{
if (this.m_SyncTransform.GetComponent<Rigidbody>() != null)
{
this.m_SyncTransform.transformSyncMode = NetworkTransform.TransformSyncMode.SyncRigidbody3D;
this.m_SyncTransform.syncRotationAxis = NetworkTransform.AxisSyncMode.AxisXYZ;
EditorUtility.SetDirty(this.m_SyncTransform);
}
else if (this.m_SyncTransform.GetComponent<Rigidbody2D>() != null)
{
this.m_SyncTransform.transformSyncMode = NetworkTransform.TransformSyncMode.SyncRigidbody2D;
this.m_SyncTransform.syncRotationAxis = NetworkTransform.AxisSyncMode.AxisZ;
EditorUtility.SetDirty(this.m_SyncTransform);
}
else if (this.m_SyncTransform.GetComponent<CharacterController>() != null)
{
this.m_SyncTransform.transformSyncMode = NetworkTransform.TransformSyncMode.SyncCharacterController;
this.m_SyncTransform.syncRotationAxis = NetworkTransform.AxisSyncMode.AxisXYZ;
EditorUtility.SetDirty(this.m_SyncTransform);
}
else
{
this.m_SyncTransform.transformSyncMode = NetworkTransform.TransformSyncMode.SyncTransform;
this.m_SyncTransform.syncRotationAxis = NetworkTransform.AxisSyncMode.AxisXYZ;
EditorUtility.SetDirty(this.m_SyncTransform);
}
}
this.m_TransformSyncMode = base.serializedObject.FindProperty("m_TransformSyncMode");
this.m_MovementTheshold = base.serializedObject.FindProperty("m_MovementTheshold");
this.m_SnapThreshold = base.serializedObject.FindProperty("m_SnapThreshold");
this.m_InterpolateRotation = base.serializedObject.FindProperty("m_InterpolateRotation");
this.m_InterpolateMovement = base.serializedObject.FindProperty("m_InterpolateMovement");
this.m_RotationSyncCompression = base.serializedObject.FindProperty("m_RotationSyncCompression");
this.m_SyncSpin = base.serializedObject.FindProperty("m_SyncSpin");
this.m_NetworkSendIntervalProperty = base.serializedObject.FindProperty("m_SendInterval");
this.m_NetworkSendIntervalLabel = new GUIContent("Network Send Rate (seconds)", "Number of network updates per second");
EditorGUI.indentLevel++;
this.m_MovementThesholdLabel = new GUIContent("Movement Threshold");
this.m_SnapThresholdLabel = new GUIContent("Snap Threshold");
this.m_InterpolateRotationLabel = new GUIContent("Interpolate Rotation Factor");
this.m_InterpolateMovementLabel = new GUIContent("Interpolate Movement Factor");
this.m_RotationSyncCompressionLabel = new GUIContent("Compress Rotation");
this.m_SyncSpinLabel = new GUIContent("Sync Angular Velocity");
EditorGUI.indentLevel--;
}
}