Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ static void Drawer_VolumeContent(SerializedProbeVolume serialized, Editor owner)
return;
}

ProbeVolume pv = (serialized.serializedObject.targetObject as ProbeVolume);

bool hasProfile = (ProbeReferenceVolume.instance.sceneData?.GetProfileForScene(pv.gameObject.scene) != null);

EditorGUI.BeginChangeCheck();
if ((serialized.serializedObject.targetObject as ProbeVolume).mightNeedRebaking)
if (pv.mightNeedRebaking)
{
var helpBoxRect = GUILayoutUtility.GetRect(new GUIContent(Styles.s_ProbeVolumeChangedMessage, EditorGUIUtility.IconContent("Warning@2x").image), EditorStyles.helpBox);
EditorGUI.HelpBox(helpBoxRect, Styles.s_ProbeVolumeChangedMessage, MessageType.Warning);
Expand All @@ -137,6 +141,13 @@ static void Drawer_VolumeContent(SerializedProbeVolume serialized, Editor owner)
if (!serialized.globalVolume.boolValue)
EditorGUILayout.PropertyField(serialized.size, Styles.s_Size);

if (!hasProfile)
{
EditorGUILayout.HelpBox("No profile information is set for the scene that owns this probe volume so no subdivision information can be retrieved.", MessageType.Warning);
}

EditorGUI.BeginDisabledGroup(!hasProfile);

var rect = EditorGUILayout.GetControlRect(true);
EditorGUI.BeginProperty(rect, Styles.s_HighestSubdivLevel, serialized.highestSubdivisionLevelOverride);
EditorGUI.BeginProperty(rect, Styles.s_LowestSubdivLevel, serialized.lowestSubdivisionLevelOverride);
Expand All @@ -148,8 +159,6 @@ static void Drawer_VolumeContent(SerializedProbeVolume serialized, Editor owner)
{
if (ProbeReferenceVolume.instance.sceneData != null)
{
ProbeVolume pv = (serialized.serializedObject.targetObject as ProbeVolume);

var profile = ProbeReferenceVolume.instance.sceneData.GetProfileForScene(pv.gameObject.scene);

if (profile != null)
Expand Down Expand Up @@ -182,7 +191,10 @@ static void Drawer_VolumeContent(SerializedProbeVolume serialized, Editor owner)
int maxSubdivInVolume = serialized.highestSubdivisionLevelOverride.intValue;
EditorGUI.indentLevel--;

EditorGUILayout.HelpBox($"The distance between probes will fluctuate between : {ProbeReferenceVolume.instance.GetDistanceBetweenProbes(maxSubdiv - maxSubdivInVolume)}m and {ProbeReferenceVolume.instance.GetDistanceBetweenProbes(maxSubdiv - minSubdivInVolume)}m", MessageType.Info);
if (hasProfile)
EditorGUILayout.HelpBox($"The distance between probes will fluctuate between : {ProbeReferenceVolume.instance.GetDistanceBetweenProbes(maxSubdivInVolume)}m and {ProbeReferenceVolume.instance.GetDistanceBetweenProbes(minSubdivInVolume)}m", MessageType.Info);

EditorGUI.EndDisabledGroup();

if (EditorGUI.EndChangeCheck())
{
Expand Down