UnityEditor.Lightmapping.BakeReflectionProbeSnapshot C# (CSharp) Method

BakeReflectionProbeSnapshot() private method

private BakeReflectionProbeSnapshot ( ReflectionProbe probe ) : bool
probe UnityEngine.ReflectionProbe
return bool
        internal static extern bool BakeReflectionProbeSnapshot(ReflectionProbe probe);
        /// <summary>

Usage Example

        void DoBakeButton()
        {
            if (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);
                }
                return;
            }

            if (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);
                return;
            }

            GUILayout.BeginHorizontal();

            GUILayout.Space(EditorGUIUtility.labelWidth);
            switch (reflectionProbeMode)
            {
            case ReflectionProbeMode.Custom:
                if (EditorGUI.ButtonWithDropdownList(Styles.bakeCustomButtonText, Styles.bakeCustomOptionText, OnBakeCustomButton))
                {
                    BakeCustomReflectionProbe(reflectionProbeTarget, true);
                    GUIUtility.ExitGUI();
                }
                break;

            case ReflectionProbeMode.Baked:
                using (new EditorGUI.DisabledScope(!reflectionProbeTarget.enabled))
                {
                    // Bake button in non-continous mode
                    if (EditorGUI.ButtonWithDropdownList(Styles.bakeButtonText, Styles.bakeButtonsText, OnBakeButton))
                    {
                        Lightmapping.BakeReflectionProbeSnapshot(reflectionProbeTarget);
                        GUIUtility.ExitGUI();
                    }
                }

                break;

            case ReflectionProbeMode.Realtime:
                // Not showing bake button in realtime
                break;
            }

            GUILayout.EndHorizontal();
        }
All Usage Examples Of UnityEditor.Lightmapping::BakeReflectionProbeSnapshot