Skip to content

Commit b29d770

Browse files
committed
Rename constantValue to fixedValue
1 parent 2d54c09 commit b29d770

19 files changed

+74
-72
lines changed

Editor/Events/EventReferencePropertyDrawer.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
2727
position = EditorGUI.PrefixLabel(position, label);
2828
}
2929

30+
int indent = EditorGUI.indentLevel;
31+
EditorGUI.indentLevel = 0;
32+
3033
Rect popupRect = new Rect(position);
3134
popupRect.width = popupStyle.fixedWidth + popupStyle.margin.right;
32-
popupRect.height = EditorGUIUtility.singleLineHeight;
33-
popupRect.y += (popupRect.height - popupStyle.fixedHeight) / 2f;
35+
popupRect.height = popupStyle.fixedHeight;
36+
popupRect.x += position.width - popupRect.width;
37+
popupRect.y += (EditorGUIUtility.singleLineHeight - popupStyle.fixedHeight) / 2f;
3438
position.width -= popupRect.width;
35-
popupRect.x += position.width;
3639

3740
EditorGUI.BeginChangeCheck();
3841

39-
int indent = EditorGUI.indentLevel;
40-
EditorGUI.indentLevel = 0;
41-
4242
int result = EditorGUI.Popup(popupRect, useUnityEvent.boolValue ? 0 : 1, popupOptions, popupStyle);
4343
useUnityEvent.boolValue = result == 0;
4444

Editor/Variables/ValueReferencePropertyDrawer.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Zigurous.Architecture.Editor
2121
[CustomPropertyDrawer(typeof(Vector4Reference), true)]
2222
public class ValueReferencePropertyDrawer : PropertyDrawer
2323
{
24-
private readonly string[] popupOptions = { "Use Constant", "Use Variable" };
24+
private readonly string[] popupOptions = { "Fixed Value", "Variable" };
2525
private static GUIStyle popupStyle;
2626

2727
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
@@ -32,29 +32,29 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
3232
popupStyle.imagePosition = ImagePosition.ImageOnly;
3333
}
3434

35-
SerializedProperty useConstant = property.FindPropertyRelative("useConstant");
36-
SerializedProperty constantValue = property.FindPropertyRelative("constantValue");
35+
SerializedProperty useVariable = property.FindPropertyRelative("useVariable");
3736
SerializedProperty variable = property.FindPropertyRelative("variable");
37+
SerializedProperty fixedValue = property.FindPropertyRelative("fixedValue");
3838

3939
label = EditorGUI.BeginProperty(position, label, property);
4040
position = EditorGUI.PrefixLabel(position, label);
4141

42+
int indent = EditorGUI.indentLevel;
43+
EditorGUI.indentLevel = 0;
44+
4245
Rect popupRect = new Rect(position);
4346
popupRect.width = popupStyle.fixedWidth + popupStyle.margin.right;
44-
popupRect.height = EditorGUIUtility.singleLineHeight;
45-
popupRect.y += (popupRect.height - popupStyle.fixedHeight) / 2f;
47+
popupRect.height = popupStyle.fixedHeight;
48+
popupRect.x += position.width - popupRect.width;
49+
popupRect.y += (EditorGUIUtility.singleLineHeight - popupStyle.fixedHeight) / 2f;
4650
position.width -= popupRect.width;
47-
popupRect.x += position.width;
4851

4952
EditorGUI.BeginChangeCheck();
5053

51-
int indent = EditorGUI.indentLevel;
52-
EditorGUI.indentLevel = 0;
53-
54-
int result = EditorGUI.Popup(popupRect, useConstant.boolValue ? 0 : 1, popupOptions, popupStyle);
55-
useConstant.boolValue = result == 0;
54+
int result = EditorGUI.Popup(popupRect, useVariable.boolValue ? 1 : 0, popupOptions, popupStyle);
55+
useVariable.boolValue = result == 1;
5656

57-
EditorGUI.PropertyField(position, useConstant.boolValue ? constantValue : variable, GUIContent.none, true);
57+
EditorGUI.PropertyField(position, useVariable.boolValue ? variable : fixedValue, GUIContent.none, true);
5858

5959
if (EditorGUI.EndChangeCheck()) {
6060
property.serializedObject.ApplyModifiedProperties();
@@ -66,11 +66,11 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
6666

6767
public override float GetPropertyHeight(SerializedProperty property, GUIContent label)
6868
{
69-
SerializedProperty useConstant = property.FindPropertyRelative("useConstant");
70-
SerializedProperty constantValue = property.FindPropertyRelative("constantValue");
69+
SerializedProperty useVariable = property.FindPropertyRelative("useVariable");
7170
SerializedProperty variable = property.FindPropertyRelative("variable");
71+
SerializedProperty fixedValue = property.FindPropertyRelative("fixedValue");
7272

73-
return EditorGUI.GetPropertyHeight(useConstant.boolValue ? constantValue : variable, true);
73+
return EditorGUI.GetPropertyHeight(useVariable.boolValue ? variable : fixedValue, true);
7474
}
7575

7676
}

Runtime/Variables/BoolReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public class BoolReference : ValueReference<bool, BoolVariable>
1212
public BoolReference() {}
1313

1414
/// <summary>
15-
/// Creates a new boolean reference with the constant value.
15+
/// Creates a new boolean reference with the fixed value.
1616
/// </summary>
17-
/// <param name="value">The constant value to set.</param>
17+
/// <param name="value">The fixed value to set.</param>
1818
public BoolReference(bool value) : base(value) {}
1919

2020
/// <summary>

Runtime/Variables/BoundsReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class BoundsReference : ValueReference<Bounds, BoundsVariable>
1414
public BoundsReference() {}
1515

1616
/// <summary>
17-
/// Creates a new Bounds reference with the constant value.
17+
/// Creates a new Bounds reference with the fixed value.
1818
/// </summary>
19-
/// <param name="value">The constant value to set.</param>
19+
/// <param name="value">The fixed value to set.</param>
2020
public BoundsReference(Bounds value) : base(value) {}
2121

2222
/// <summary>

Runtime/Variables/DoubleReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public class DoubleReference : ValueReference<double, DoubleVariable>
1212
public DoubleReference() {}
1313

1414
/// <summary>
15-
/// Creates a new double reference with the constant value.
15+
/// Creates a new double reference with the fixed value.
1616
/// </summary>
17-
/// <param name="value">The constant value to set.</param>
17+
/// <param name="value">The fixed value to set.</param>
1818
public DoubleReference(double value) : base(value) {}
1919

2020
/// <summary>

Runtime/Variables/FloatReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public class FloatReference : ValueReference<float, FloatVariable>
1212
public FloatReference() {}
1313

1414
/// <summary>
15-
/// Creates a new float reference with the constant value.
15+
/// Creates a new float reference with the fixed value.
1616
/// </summary>
17-
/// <param name="value">The constant value to set.</param>
17+
/// <param name="value">The fixed value to set.</param>
1818
public FloatReference(float value) : base(value) {}
1919

2020
/// <summary>

Runtime/Variables/IntReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public class IntReference : ValueReference<int, IntVariable>
1212
public IntReference() {}
1313

1414
/// <summary>
15-
/// Creates a new int reference with the constant value.
15+
/// Creates a new int reference with the fixed value.
1616
/// </summary>
17-
/// <param name="value">The constant value to set.</param>
17+
/// <param name="value">The fixed value to set.</param>
1818
public IntReference(int value) : base(value) {}
1919

2020
/// <summary>

Runtime/Variables/LongReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ public class LongReference : ValueReference<long, LongVariable>
1212
public LongReference() {}
1313

1414
/// <summary>
15-
/// Creates a new long reference with the constant value.
15+
/// Creates a new long reference with the fixed value.
1616
/// </summary>
17-
/// <param name="value">The constant value to set.</param>
17+
/// <param name="value">The fixed value to set.</param>
1818
public LongReference(long value) : base(value) {}
1919

2020
/// <summary>

Runtime/Variables/QuaternionReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class QuaternionReference : ValueReference<Quaternion, QuaternionVariable
1414
public QuaternionReference() {}
1515

1616
/// <summary>
17-
/// Creates a new Quaternion reference with the constant value.
17+
/// Creates a new Quaternion reference with the fixed value.
1818
/// </summary>
19-
/// <param name="value">The constant value to set.</param>
19+
/// <param name="value">The fixed value to set.</param>
2020
public QuaternionReference(Quaternion value) : base(value) {}
2121

2222
/// <summary>

Runtime/Variables/RectReference.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class RectReference : ValueReference<Rect, RectVariable>
1414
public RectReference() {}
1515

1616
/// <summary>
17-
/// Creates a new Rect reference with the constant value.
17+
/// Creates a new Rect reference with the fixed value.
1818
/// </summary>
19-
/// <param name="value">The constant value to set.</param>
19+
/// <param name="value">The fixed value to set.</param>
2020
public RectReference(Rect value) : base(value) {}
2121

2222
/// <summary>

0 commit comments

Comments
 (0)