HasNormals() private static method

private static HasNormals ( Renderer renderer ) : bool
renderer UnityEngine.Renderer
return bool
Exemplo n.º 1
0
        public bool EditRenderers()
        {
            GameObject[] array;
            Renderer[]   selectedObjectsOfType = SceneModeUtility.GetSelectedObjectsOfType <Renderer>(out array, new Type[]
            {
                typeof(MeshRenderer),
                typeof(SkinnedMeshRenderer)
            });
            if (array.Length == 0)
            {
                return(false);
            }
            EditorGUILayout.InspectorTitlebar(selectedObjectsOfType);
            SerializedObject serializedObject = new SerializedObject(array);

            EditorGUI.BeginDisabledGroup(!SceneModeUtility.StaticFlagField("Lightmap Static", serializedObject.FindProperty("m_StaticEditorFlags"), 1));
            SerializedObject serializedObject2 = new SerializedObject(selectedObjectsOfType);
            float            num = LightmapVisualization.GetLightmapLODLevelScale(selectedObjectsOfType[0]);

            for (int i = 1; i < selectedObjectsOfType.Length; i++)
            {
                if (!Mathf.Approximately(num, LightmapVisualization.GetLightmapLODLevelScale(selectedObjectsOfType[i])))
                {
                    num = 1f;
                }
            }
            float lightmapScale     = this.LightmapScaleGUI(serializedObject2, num) * LightmapVisualization.GetLightmapLODLevelScale(selectedObjectsOfType[0]);
            float cachedSurfaceArea = (!(selectedObjectsOfType[0] is MeshRenderer)) ? InternalMeshUtil.GetCachedSkinnedMeshSurfaceArea(selectedObjectsOfType[0] as SkinnedMeshRenderer) : InternalMeshUtil.GetCachedMeshSurfaceArea(selectedObjectsOfType[0] as MeshRenderer);

            this.ShowClampedSizeInLightmapGUI(lightmapScale, cachedSurfaceArea);
            this.RendererUVSettings(serializedObject2);
            LightingWindowObjectTab.LightmapParametersGUI(serializedObject2.FindProperty("m_LightmapParameters"), LightingWindowObjectTab.s_Styles.LightmapParameters);
            this.m_ShowBakedLM = EditorGUILayout.Foldout(this.m_ShowBakedLM, LightingWindowObjectTab.s_Styles.Atlas);
            if (this.m_ShowBakedLM)
            {
                this.ShowAtlasGUI(serializedObject2);
            }
            this.m_ShowRealtimeLM = EditorGUILayout.Foldout(this.m_ShowRealtimeLM, LightingWindowObjectTab.s_Styles.RealtimeLM);
            if (this.m_ShowRealtimeLM)
            {
                this.ShowRealtimeLMGUI(serializedObject2, selectedObjectsOfType[0]);
            }
            if (LightmapEditorSettings.HasZeroAreaMesh(selectedObjectsOfType[0]))
            {
                EditorGUILayout.HelpBox(LightingWindowObjectTab.s_Styles.ZeroAreaPackingMesh.text, MessageType.Warning);
            }
            if (LightmapEditorSettings.HasClampedResolution(selectedObjectsOfType[0]))
            {
                EditorGUILayout.HelpBox(LightingWindowObjectTab.s_Styles.ClampedPackingResolution.text, MessageType.Warning);
            }
            if (!LightingWindowObjectTab.HasNormals(selectedObjectsOfType[0]))
            {
                EditorGUILayout.HelpBox(LightingWindowObjectTab.s_Styles.NoNormalsNoLightmapping.text, MessageType.Warning);
            }
            serializedObject.ApplyModifiedProperties();
            serializedObject2.ApplyModifiedProperties();
            EditorGUI.EndDisabledGroup();
            GUILayout.Space(10f);
            return(true);
        }