UnityEditor.ReflectionProbeEditor.DoBakeButton C# (CSharp) Method

DoBakeButton() private method

private DoBakeButton ( ) : void
return void
        private void DoBakeButton()
        {
            if (this.reflectionProbeTarget.mode == ReflectionProbeMode.Realtime)
            {
                EditorGUILayout.HelpBox("Baking of this reflection probe should be initiated from the scripting API because the type is 'Realtime'", MessageType.Info);
                if (!QualitySettings.realtimeReflectionProbes)
                {
                    EditorGUILayout.HelpBox("Realtime reflection probes are disabled in Quality Settings", MessageType.Warning);
                }
            }
            else if ((this.reflectionProbeTarget.mode == ReflectionProbeMode.Baked) && (Lightmapping.giWorkflowMode != Lightmapping.GIWorkflowMode.OnDemand))
            {
                EditorGUILayout.HelpBox("Baking of this reflection probe is automatic because this probe's type is 'Baked' and the Lighting window is using 'Auto Baking'. The cubemap created is stored in the GI cache.", MessageType.Info);
            }
            else
            {
                GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                GUILayout.Space(EditorGUIUtility.labelWidth);
                switch (this.reflectionProbeMode)
                {
                    case ReflectionProbeMode.Custom:
                        if (EditorGUI.ButtonWithDropdownList(Styles.bakeCustomButtonText, Styles.bakeCustomOptionText, new GenericMenu.MenuFunction2(this.OnBakeCustomButton), new GUILayoutOption[0]))
                        {
                            this.BakeCustomReflectionProbe(this.reflectionProbeTarget, true);
                            GUIUtility.ExitGUI();
                        }
                        break;

                    case ReflectionProbeMode.Baked:
                        using (new EditorGUI.DisabledScope(!this.reflectionProbeTarget.enabled))
                        {
                            if (EditorGUI.ButtonWithDropdownList(Styles.bakeButtonText, Styles.bakeButtonsText, new GenericMenu.MenuFunction2(this.OnBakeButton), new GUILayoutOption[0]))
                            {
                                Lightmapping.BakeReflectionProbeSnapshot(this.reflectionProbeTarget);
                                GUIUtility.ExitGUI();
                            }
                        }
                        break;
                }
                GUILayout.EndHorizontal();
            }
        }