public override void OnInspectorGUI()
{
Rigidbody2D target = base.target as Rigidbody2D;
base.serializedObject.Update();
EditorGUILayout.PropertyField(this.m_BodyType, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_Material, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_Simulated, new GUILayoutOption[0]);
if (this.m_BodyType.hasMultipleDifferentValues)
{
EditorGUILayout.HelpBox("Cannot edit properties that are body type specific when the selection contains different body types.", MessageType.Info);
}
else
{
this.m_ShowIsStatic.target = target.bodyType != RigidbodyType2D.Static;
if (EditorGUILayout.BeginFadeGroup(this.m_ShowIsStatic.faded))
{
this.m_ShowIsKinematic.target = target.bodyType != RigidbodyType2D.Kinematic;
if (EditorGUILayout.BeginFadeGroup(this.m_ShowIsKinematic.faded))
{
EditorGUILayout.PropertyField(this.m_UseAutoMass, new GUILayoutOption[0]);
EditorGUI.BeginDisabledGroup(target.useAutoMass);
EditorGUILayout.PropertyField(this.m_Mass, new GUILayoutOption[0]);
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(this.m_LinearDrag, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_AngularDrag, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_GravityScale, new GUILayoutOption[0]);
}
FixedEndFadeGroup(this.m_ShowIsKinematic.faded);
if (!this.m_ShowIsKinematic.target)
{
EditorGUILayout.PropertyField(this.m_UseFullKinematicContacts, new GUILayoutOption[0]);
}
EditorGUILayout.PropertyField(this.m_CollisionDetection, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_SleepingMode, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_Interpolate, new GUILayoutOption[0]);
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
this.m_Constraints.isExpanded = EditorGUILayout.Foldout(this.m_Constraints.isExpanded, "Constraints", true);
GUILayout.EndHorizontal();
RigidbodyConstraints2D intValue = (RigidbodyConstraints2D) this.m_Constraints.intValue;
if (this.m_Constraints.isExpanded)
{
EditorGUI.indentLevel++;
this.ToggleFreezePosition(intValue, m_FreezePositionLabel, 0, 1);
this.ToggleFreezeRotation(intValue, m_FreezeRotationLabel, 2);
EditorGUI.indentLevel--;
}
if (intValue == RigidbodyConstraints2D.FreezeAll)
{
EditorGUILayout.HelpBox("Rather than turning on all constraints, you may want to consider removing the Rigidbody2D component which makes any colliders static. This gives far better performance overall.", MessageType.Info);
}
}
FixedEndFadeGroup(this.m_ShowIsStatic.faded);
}
base.serializedObject.ApplyModifiedProperties();
this.ShowBodyInfoProperties();
}