static void Drawer_ReflectionProbeMode(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
 {
     EditorGUI.BeginChangeCheck();
     EditorGUI.showMixedValue = p.mode.hasMultipleDifferentValues;
     EditorGUILayout.IntPopup(p.mode, k_Content_ReflectionProbeMode, k_Content_ReflectionProbeModeValues, CoreEditorUtils.GetContent("Type|'Baked Cubemap' uses the 'Auto Baking' mode from the Lighting window. If it is enabled then baking is automatic otherwise manual bake is needed (use the bake button below). \n'Custom' can be used if a custom cubemap is wanted. \n'Realtime' can be used to dynamically re-render the cubemap during runtime (via scripting)."));
     EditorGUI.showMixedValue = false;
     if (EditorGUI.EndChangeCheck())
     {
         s.SetModeTarget(p.mode.intValue);
         foreach (var targetObject in p.so.targetObjects)
         {
             HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial((ReflectionProbe)targetObject);
         }
     }
 }
        static void Drawer_BakeActions(HDReflectionProbeUI s, SerializedHDReflectionProbe p, Editor owner)
        {
            if (p.mode.intValue == (int)ReflectionProbeMode.Realtime)
            {
                EditorGUILayout.HelpBox("Refresh 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 (p.mode.intValue == (int)ReflectionProbeMode.Baked && UnityEditor.Lightmapping.giWorkflowMode != UnityEditor.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;
            }

            EditorGUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            switch ((ReflectionProbeMode)p.mode.intValue)
            {
            case ReflectionProbeMode.Custom:
            {
                if (ButtonWithDropdownList(
                        CoreEditorUtils.GetContent("Bake|Bakes Reflection Probe's cubemap, overwriting the existing cubemap texture asset (if any)."), k_BakeCustomOptionText,
                        data =>
                    {
                        var mode = (int)data;

                        var probe = p.target;
                        if (mode == 0)
                        {
                            HDReflectionProbeEditorUtility.BakeCustomReflectionProbe(probe, false, true);
                            HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial(probe);
                        }
                    },
                        GUILayout.ExpandWidth(true)))
                {
                    var probe = p.target;
                    HDReflectionProbeEditorUtility.BakeCustomReflectionProbe(probe, true, true);
                    HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial(probe);
                    GUIUtility.ExitGUI();
                }
                break;
            }

            case ReflectionProbeMode.Baked:
            {
                GUI.enabled = p.target.enabled;

                // Bake button in non-continous mode
                if (ButtonWithDropdownList(
                        CoreEditorUtils.GetContent("Bake"),
                        k_BakeButtonsText,
                        data =>
                    {
                        var mode = (int)data;
                        if (mode == 0)
                        {
                            HDReflectionProbeEditorUtility.BakeAllReflectionProbesSnapshots();
                        }
                    },
                        GUILayout.ExpandWidth(true)))
                {
                    var probe = p.target;
                    HDReflectionProbeEditorUtility.BakeReflectionProbeSnapshot(probe);
                    HDReflectionProbeEditorUtility.ResetProbeSceneTextureInMaterial(probe);
                    GUIUtility.ExitGUI();
                }

                GUI.enabled = true;
                break;
            }

            case ReflectionProbeMode.Realtime:
                // Not showing bake button in realtime
                break;
            }
            GUILayout.FlexibleSpace();
            EditorGUILayout.EndHorizontal();
        }