Skip to content

Commit 921b372

Browse files
committed
Fixed enum error again
1 parent f9ae6d2 commit 921b372

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Assets/com.alelievr.NodeGraphProcessor/Editor/Utils/ExposedParameterDrawer.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
5959
container.Add(new IMGUIContainer(() => {
6060
float newValue;
6161
EditorGUIUtility.labelWidth = 150;
62-
if ((FloatParameter.FloatMode)mode.enumValueIndex == FloatParameter.FloatMode.Slider)
62+
if ((FloatParameter.FloatMode)mode.intValue == FloatParameter.FloatMode.Slider)
6363
{
6464
newValue = EditorGUILayout.Slider(name.stringValue, val.floatValue, min.floatValue, max.floatValue);
6565
newValue = Mathf.Clamp(newValue, min.floatValue, max.floatValue);
@@ -94,7 +94,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
9494
container.Add(new IMGUIContainer(() => {
9595
int newValue;
9696
EditorGUIUtility.labelWidth = 150;
97-
if ((IntParameter.IntMode)mode.enumValueIndex == IntParameter.IntMode.Slider)
97+
if ((IntParameter.IntMode)mode.intValue == IntParameter.IntMode.Slider)
9898
{
9999
newValue = EditorGUILayout.IntSlider(name.stringValue, val.intValue, min.intValue, max.intValue);
100100
newValue = Mathf.Clamp(newValue, min.intValue, max.intValue);
@@ -129,7 +129,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
129129
container.Add(new IMGUIContainer(() => {
130130
EditorGUIUtility.labelWidth = 150;
131131
EditorGUI.BeginChangeCheck();
132-
if ((Vector2Parameter.Vector2Mode)mode.enumValueIndex == Vector2Parameter.Vector2Mode.MinMaxSlider)
132+
if ((Vector2Parameter.Vector2Mode)mode.intValue == Vector2Parameter.Vector2Mode.MinMaxSlider)
133133
{
134134
float x = val.vector2Value.x;
135135
float y = val.vector2Value.y;
@@ -154,7 +154,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
154154
{
155155
var name = GetNameProperty(property);
156156
var settings = GetSettingsProperty(property);
157-
var mode = (GradientParameter.GradientColorMode)settings.FindPropertyRelative(nameof(GradientParameter.GradientSettings.mode)).enumValueIndex;
157+
var mode = (GradientParameter.GradientColorMode)settings.FindPropertyRelative(nameof(GradientParameter.GradientSettings.mode)).intValue;
158158
if (mode == GradientParameter.GradientColorMode.HDR)
159159
return new PropertyField(property.FindPropertyRelative("hdrVal"), name.stringValue);
160160
else
@@ -170,7 +170,7 @@ public override VisualElement CreatePropertyGUI(SerializedProperty property)
170170
var name = GetNameProperty(property);
171171
var settings = GetSettingsProperty(property);
172172
var val = GetValProperty(property);
173-
var mode = (ColorParameter.ColorMode)settings.FindPropertyRelative(nameof(ColorParameter.ColorSettings.mode)).enumValueIndex;
173+
var mode = (ColorParameter.ColorMode)settings.FindPropertyRelative(nameof(ColorParameter.ColorSettings.mode)).intValue;
174174

175175
var colorField = new ColorField(name.stringValue) { value = val.colorValue, hdr = mode == ColorParameter.ColorMode.HDR };
176176
colorField.RegisterValueChangedCallback(e => {
@@ -265,7 +265,7 @@ void UpdateVisibility(SerializedProperty property)
265265
{
266266
if (property == null)
267267
return;
268-
var newValue = (FloatParameter.FloatMode)property.enumValueIndex;
268+
var newValue = (FloatParameter.FloatMode)property.intValue;
269269

270270
if (newValue == FloatParameter.FloatMode.Slider)
271271
min.style.display = max.style.display = DisplayStyle.Flex;
@@ -301,7 +301,7 @@ void UpdateVisibility(SerializedProperty property)
301301
{
302302
if (property == null)
303303
return;
304-
var newValue = (IntParameter.IntMode)property.enumValueIndex;
304+
var newValue = (IntParameter.IntMode)property.intValue;
305305

306306
if (newValue == IntParameter.IntMode.Slider)
307307
min.style.display = max.style.display = DisplayStyle.Flex;

0 commit comments

Comments
 (0)