-
-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathValueRangeEditorWindow.cs
More file actions
36 lines (30 loc) · 1.18 KB
/
Copy pathValueRangeEditorWindow.cs
File metadata and controls
36 lines (30 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using UnityEditor;
using UnityEngine;
namespace UnityVolumeRendering
{
public class ValueRangeEditorWindow : EditorWindow
{
public static void ShowWindow()
{
ValueRangeEditorWindow wnd = new ValueRangeEditorWindow();
wnd.Show();
}
private void OnGUI()
{
// Update selected object
VolumeRenderedObject volRendObject = SelectionHelper.GetSelectedVolumeObject();
if (volRendObject == null)
volRendObject = GameObject.FindObjectOfType<VolumeRenderedObject>();
if (volRendObject == null)
return;
EditorGUILayout.LabelField("Edit the visible value range (min/max value) with the slider.");
Vector2 visibilityWindow = volRendObject.GetVisibilityWindow();
EditorGUILayout.BeginHorizontal();
EditorGUILayout.MinMaxSlider("Visible value range", ref visibilityWindow.x, ref visibilityWindow.y, 0.0f, 1.0f);
EditorGUILayout.Space();
EditorGUILayout.Space();
EditorGUILayout.EndHorizontal();
volRendObject.SetVisibilityWindow(visibilityWindow);
}
}
}