public override void OnInspectorGUI()
{
base.serializedObject.Update();
bool flag = false;
SerializedProperty serializedProperty = base.serializedObject.FindProperty("m_Materials");
if (!serializedProperty.hasMultipleDifferentValues)
{
MeshFilter component = ((MeshRenderer)base.serializedObject.targetObject).GetComponent <MeshFilter>();
flag = (component != null && component.sharedMesh != null && serializedProperty.arraySize > component.sharedMesh.subMeshCount);
}
EditorGUILayout.PropertyField(this.m_CastShadows, true, new GUILayoutOption[0]);
bool disabled = SceneView.IsUsingDeferredRenderingPath();
using (new EditorGUI.DisabledScope(disabled))
{
EditorGUILayout.PropertyField(this.m_ReceiveShadows, true, new GUILayoutOption[0]);
}
EditorGUILayout.PropertyField(this.m_MotionVectors, true, new GUILayoutOption[0]);
EditorGUILayout.PropertyField(this.m_Materials, true, new GUILayoutOption[0]);
if (!this.m_Materials.hasMultipleDifferentValues && flag)
{
EditorGUILayout.HelpBox("This renderer has more materials than the Mesh has submeshes. Multiple materials will be applied to the same submesh, which costs performance. Consider using multiple shader passes.", MessageType.Warning, true);
}
if (ShaderUtil.MaterialsUseInstancingShader(serializedProperty))
{
this.m_GameObjectsSerializedObject.Update();
if (!this.m_GameObjectStaticFlags.hasMultipleDifferentValues && (this.m_GameObjectStaticFlags.intValue & 4) != 0)
{
EditorGUILayout.HelpBox("This renderer is statically batched and uses an instanced shader at the same time. Instancing will be disabled in such a case. Consider disabling static batching if you want it to be instanced.", MessageType.Warning, true);
}
}
base.RenderProbeFields();
base.serializedObject.ApplyModifiedProperties();
}