IsLightmappedOrDynamicLightmappedForRendering() private method

private IsLightmappedOrDynamicLightmappedForRendering ( Renderer renderer ) : bool
renderer UnityEngine.Renderer
return bool
示例#1
0
            internal void OnGUI(Renderer renderer, bool useMiniStyle)
            {
                if (this.m_UseLightProbes != null)
                {
                    EditorGUI.BeginDisabledGroup(LightmapEditorSettings.IsLightmappedOrDynamicLightmappedForRendering(renderer));
                    if (!useMiniStyle)
                    {
                        EditorGUILayout.PropertyField(this.m_UseLightProbes, this.m_UseLightProbesStyle, new GUILayoutOption[0]);
                    }
                    else
                    {
                        ModuleUI.GUIToggle(this.m_UseLightProbesStyle, this.m_UseLightProbes);
                    }
                    EditorGUI.EndDisabledGroup();
                }
                if (!useMiniStyle)
                {
                    this.m_ReflectionProbeUsage.intValue = (int)((ReflectionProbeUsage)EditorGUILayout.EnumPopup(this.m_ReflectionProbeUsageStyle, (ReflectionProbeUsage)this.m_ReflectionProbeUsage.intValue, new GUILayoutOption[0]));
                }
                else
                {
                    ModuleUI.GUIPopup(this.m_ReflectionProbeUsageStyle, this.m_ReflectionProbeUsage, Enum.GetNames(typeof(ReflectionProbeUsage)));
                }
                bool flag = this.m_ReflectionProbeUsage.intValue != 0;

                if (((this.m_UseLightProbes != null) && this.m_UseLightProbes.boolValue) || flag)
                {
                    EditorGUI.indentLevel++;
                    if (!useMiniStyle)
                    {
                        EditorGUILayout.PropertyField(this.m_ProbeAnchor, this.m_ProbeAnchorStyle, new GUILayoutOption[0]);
                    }
                    else
                    {
                        ModuleUI.GUIObject(this.m_ProbeAnchorStyle, this.m_ProbeAnchor);
                    }
                    if (flag)
                    {
                        if (SceneView.GetSceneViewRenderingPath() == RenderingPath.DeferredShading)
                        {
                            EditorGUILayout.HelpBox(this.m_DeferredNote.text, MessageType.Info);
                        }
                        else
                        {
                            renderer.GetClosestReflectionProbes(this.m_BlendInfo);
                            ShowClosestReflectionProbes(this.m_BlendInfo);
                        }
                    }
                    EditorGUI.indentLevel--;
                }
            }
示例#2
0
            internal void OnGUI(UnityEngine.Object[] selection, Renderer renderer, bool useMiniStyle)
            {
                int  selectionCount = 1;
                bool flag           = SceneView.IsUsingDeferredRenderingPath();
                bool flag2          = flag && UnityEngine.Rendering.GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredReflections) != BuiltinShaderMode.Disabled;
                bool usesLightMaps  = false;

                if (selection != null)
                {
                    for (int i = 0; i < selection.Length; i++)
                    {
                        UnityEngine.Object @object = selection[i];
                        if (LightmapEditorSettings.IsLightmappedOrDynamicLightmappedForRendering((Renderer)@object))
                        {
                            usesLightMaps = true;
                            break;
                        }
                    }
                    selectionCount = selection.Length;
                }
                this.RenderLightProbeUsage(selectionCount, renderer, useMiniStyle, usesLightMaps);
                this.RenderReflectionProbeUsage(useMiniStyle, flag, flag2);
                bool flag3 = this.RenderProbeAnchor(useMiniStyle);

                if (flag3)
                {
                    bool flag4 = !this.m_ReflectionProbeUsage.hasMultipleDifferentValues && this.m_ReflectionProbeUsage.intValue != 0;
                    if (flag4)
                    {
                        if (!flag2)
                        {
                            renderer.GetClosestReflectionProbes(this.m_BlendInfo);
                            RendererEditorBase.Probes.ShowClosestReflectionProbes(this.m_BlendInfo);
                        }
                    }
                }
                bool flag5 = !this.m_ReceiveShadows.hasMultipleDifferentValues && this.m_ReceiveShadows.boolValue;

                if ((flag && flag5) || (flag2 && flag3))
                {
                    EditorGUILayout.HelpBox(this.m_DeferredNote.text, MessageType.Info);
                }
                this.RenderLightProbeProxyVolumeWarningNote(renderer, selectionCount);
            }
 internal void OnGUI(UnityEngine.Object[] targets, Renderer renderer, bool useMiniStyle)
 {
   bool disabled1 = SceneView.IsUsingDeferredRenderingPath();
   bool flag1 = disabled1 && UnityEngine.Rendering.GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredReflections) != UnityEngine.Rendering.BuiltinShaderMode.Disabled;
   bool disabled2 = false;
   if (targets != null)
   {
     foreach (Renderer target in targets)
     {
       if (LightmapEditorSettings.IsLightmappedOrDynamicLightmappedForRendering(target))
       {
         disabled2 = true;
         break;
       }
     }
   }
   if (this.m_UseLightProbes != null)
   {
     EditorGUI.BeginDisabledGroup(disabled2);
     if (!useMiniStyle)
     {
       if (disabled2)
         EditorGUILayout.Toggle(this.m_UseLightProbesStyle, false, new GUILayoutOption[0]);
       else
         EditorGUILayout.PropertyField(this.m_UseLightProbes, this.m_UseLightProbesStyle, new GUILayoutOption[0]);
     }
     else if (disabled2)
       ModuleUI.GUIToggle(this.m_UseLightProbesStyle, false);
     else
       ModuleUI.GUIToggle(this.m_UseLightProbesStyle, this.m_UseLightProbes);
     EditorGUI.EndDisabledGroup();
   }
   EditorGUI.BeginDisabledGroup(disabled1);
   if (!useMiniStyle)
   {
     if (flag1)
       EditorGUILayout.EnumPopup(this.m_ReflectionProbeUsageStyle, (Enum) (ReflectionProbeUsage) (this.m_ReflectionProbeUsage.intValue == 0 ? 0 : 3), new GUILayoutOption[0]);
     else
       EditorGUILayout.Popup(this.m_ReflectionProbeUsage, this.m_ReflectionProbeUsageOptions, this.m_ReflectionProbeUsageStyle, new GUILayoutOption[0]);
   }
   else if (flag1)
     ModuleUI.GUIPopup(this.m_ReflectionProbeUsageStyle, 3, this.m_ReflectionProbeUsageNames);
   else
     ModuleUI.GUIPopup(this.m_ReflectionProbeUsageStyle, this.m_ReflectionProbeUsage, this.m_ReflectionProbeUsageNames);
   EditorGUI.EndDisabledGroup();
   bool flag2 = !this.m_ReflectionProbeUsage.hasMultipleDifferentValues && this.m_ReflectionProbeUsage.intValue != 0 || this.m_UseLightProbes != null && !this.m_UseLightProbes.hasMultipleDifferentValues && this.m_UseLightProbes.boolValue;
   if (flag2)
   {
     if (!useMiniStyle)
       EditorGUILayout.PropertyField(this.m_ProbeAnchor, this.m_ProbeAnchorStyle, new GUILayoutOption[0]);
     else
       ModuleUI.GUIObject(this.m_ProbeAnchorStyle, this.m_ProbeAnchor);
     if (!flag1)
     {
       renderer.GetClosestReflectionProbes(this.m_BlendInfo);
       RendererEditorBase.Probes.ShowClosestReflectionProbes(this.m_BlendInfo);
     }
   }
   bool flag3 = !this.m_ReceiveShadows.hasMultipleDifferentValues && this.m_ReceiveShadows.boolValue;
   if ((!disabled1 || !flag3) && (!flag1 || !flag2))
     return;
   EditorGUILayout.HelpBox(this.m_DeferredNote.text, MessageType.Info);
 }
示例#4
0
            internal void OnGUI(UnityEngine.Object[] targets, Renderer renderer, bool useMiniStyle)
            {
                bool flag     = SceneView.IsUsingDeferredRenderingPath();
                bool flag2    = flag && UnityEngine.Rendering.GraphicsSettings.GetShaderMode(BuiltinShaderType.DeferredReflections) != BuiltinShaderMode.Disabled;
                bool disabled = false;

                if (targets != null)
                {
                    for (int i = 0; i < targets.Length; i++)
                    {
                        UnityEngine.Object @object = targets[i];
                        if (LightmapEditorSettings.IsLightmappedOrDynamicLightmappedForRendering((Renderer)@object))
                        {
                            disabled = true;
                            break;
                        }
                    }
                }
                if (this.m_UseLightProbes != null)
                {
                    EditorGUI.BeginDisabledGroup(disabled);
                    if (!useMiniStyle)
                    {
                        EditorGUILayout.PropertyField(this.m_UseLightProbes, this.m_UseLightProbesStyle, new GUILayoutOption[0]);
                    }
                    else
                    {
                        ModuleUI.GUIToggle(this.m_UseLightProbesStyle, this.m_UseLightProbes);
                    }
                    EditorGUI.EndDisabledGroup();
                }
                EditorGUI.BeginDisabledGroup(flag);
                if (!useMiniStyle)
                {
                    if (flag2)
                    {
                        EditorGUILayout.EnumPopup(this.m_ReflectionProbeUsageStyle, (this.m_ReflectionProbeUsage.intValue == 0) ? ReflectionProbeUsage.Off : ReflectionProbeUsage.Simple, new GUILayoutOption[0]);
                    }
                    else
                    {
                        EditorGUILayout.Popup(this.m_ReflectionProbeUsage, this.m_ReflectionProbeUsageOptions, this.m_ReflectionProbeUsageStyle, new GUILayoutOption[0]);
                    }
                }
                else if (flag2)
                {
                    ModuleUI.GUIPopup(this.m_ReflectionProbeUsageStyle, 3, this.m_ReflectionProbeUsageNames);
                }
                else
                {
                    ModuleUI.GUIPopup(this.m_ReflectionProbeUsageStyle, this.m_ReflectionProbeUsage, this.m_ReflectionProbeUsageNames);
                }
                EditorGUI.EndDisabledGroup();
                bool flag3 = !this.m_ReflectionProbeUsage.hasMultipleDifferentValues && this.m_ReflectionProbeUsage.intValue != 0;
                bool flag4 = this.m_UseLightProbes != null && !this.m_UseLightProbes.hasMultipleDifferentValues && this.m_UseLightProbes.boolValue;
                bool flag5 = flag3 || flag4;

                if (flag5)
                {
                    if (!useMiniStyle)
                    {
                        EditorGUILayout.PropertyField(this.m_ProbeAnchor, this.m_ProbeAnchorStyle, new GUILayoutOption[0]);
                    }
                    else
                    {
                        ModuleUI.GUIObject(this.m_ProbeAnchorStyle, this.m_ProbeAnchor);
                    }
                    if (!flag2)
                    {
                        renderer.GetClosestReflectionProbes(this.m_BlendInfo);
                        RendererEditorBase.Probes.ShowClosestReflectionProbes(this.m_BlendInfo);
                    }
                }
                bool flag6 = !this.m_ReceiveShadows.hasMultipleDifferentValues && this.m_ReceiveShadows.boolValue;

                if ((flag && flag6) || (flag2 && flag5))
                {
                    EditorGUILayout.HelpBox(this.m_DeferredNote.text, MessageType.Info);
                }
            }