change: finished and cleaned all settings changes, code commented, smoothing and easing are now exponential
This commit is contained in:
@@ -16,14 +16,10 @@ using UnityEngine;
|
||||
GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(200.0f),
|
||||
};
|
||||
|
||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label(_instance.label, labelOptions);
|
||||
GUILayout.Label(_instance.label, ValueGroupEditorUtilities.titleText);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Create the x settings enum
|
||||
@@ -66,13 +62,9 @@ using UnityEngine;
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(200.0f),
|
||||
};
|
||||
|
||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label(_instance.label, labelOptions);
|
||||
GUILayout.Label(_instance.label, ValueGroupEditorUtilities.titleText);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Create the x settings enum
|
||||
@@ -105,14 +97,11 @@ using UnityEngine;
|
||||
GUILayout.MinWidth(100.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(200.0f),
|
||||
};
|
||||
|
||||
|
||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label(_instance.label, labelOptions);
|
||||
GUILayout.Label(_instance.label, ValueGroupEditorUtilities.titleText);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Create the x settings enum
|
||||
@@ -152,22 +141,9 @@ using UnityEngine;
|
||||
GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(200.0f),
|
||||
};
|
||||
|
||||
GUIStyle titleText = new GUIStyle{
|
||||
fontSize = 12,
|
||||
fontStyle = FontStyle.Bold,
|
||||
padding = new RectOffset(8, 0, 3,0),
|
||||
normal ={
|
||||
textColor = Color.white
|
||||
}
|
||||
};
|
||||
|
||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||
GUILayout.Label(_instance.label, titleText);
|
||||
GUILayout.Label(_instance.label, ValueGroupEditorUtilities.titleText);
|
||||
|
||||
// End the label
|
||||
GUILayout.EndHorizontal();
|
||||
@@ -210,14 +186,10 @@ using UnityEngine;
|
||||
GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(200.0f),
|
||||
};
|
||||
|
||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label(_instance.label, labelOptions);
|
||||
GUILayout.Label(_instance.label, ValueGroupEditorUtilities.titleText);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Create the x settings enum
|
||||
@@ -292,14 +264,10 @@ using UnityEngine;
|
||||
GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(200.0f),
|
||||
};
|
||||
|
||||
// Start the Vertical layout then add the label before adding a horizontal so the label will be on top of side-by-side options
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label(_instance.label, labelOptions);
|
||||
GUILayout.Label(_instance.label, ValueGroupEditorUtilities.titleText);
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Create the x settings enum
|
||||
@@ -354,49 +322,73 @@ using UnityEngine;
|
||||
|
||||
// Set layout options for the label and the float fields
|
||||
GUILayoutOption[] floatOptions = new GUILayoutOption[] {
|
||||
GUILayout.Width(300.0f),
|
||||
GUILayout.MinWidth(20.0f),
|
||||
// GUILayout.Width(300.0f),
|
||||
// GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
GUILayoutOption[] labelOptions = new GUILayoutOption[]{
|
||||
GUILayout.Width(60.0f),
|
||||
};
|
||||
|
||||
// Start a Horiztonal Section
|
||||
// Add the label
|
||||
GUILayout.Label(_instance.label, ValueGroupEditorUtilities.titleText);
|
||||
|
||||
// Start the smoothing and easing section
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
// Add the left side label
|
||||
GUILayout.Label(_instance.label, labelOptions);
|
||||
|
||||
// Create the height settings enum
|
||||
_instance.changeHeight.value = (ValueChangeAction)EditorGUILayout.EnumPopup("", _instance.changeHeight.value);
|
||||
|
||||
// Create the value/disabled information field
|
||||
if (_instance.changeHeight.value == ValueChangeAction.NewValue){
|
||||
_instance.height.value = EditorGUILayout.FloatField(_instance.height.value, floatOptions);
|
||||
|
||||
GUIStyle smallText= new GUIStyle{
|
||||
fontSize = 10,
|
||||
padding = new RectOffset(8, 0, 0,0),
|
||||
normal ={
|
||||
textColor = Color.gray + Color.gray / 2f
|
||||
}
|
||||
};
|
||||
|
||||
// Start the left side for height
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
// Draw the label
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Height", smallText);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// Height
|
||||
BBParameterEditor.ParameterField("", _instance.changeHeight);
|
||||
|
||||
if (_instance.changeHeight.value == ValueChangeAction.NewValue || _instance.changeHeight.value == ValueChangeAction.RelativeValue){
|
||||
// _instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
|
||||
BBParameterEditor.ParameterField("", _instance.height);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeHeight.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// It do what it do.
|
||||
GUILayout.Space(5);
|
||||
|
||||
// Create the radius settings enum
|
||||
_instance.changeRadius.value = (ValueChangeAction)EditorGUILayout.EnumPopup("", _instance.changeRadius.value);
|
||||
|
||||
// Create the value/disabled information field
|
||||
if (_instance.changeRadius.value == ValueChangeAction.NewValue){
|
||||
_instance.radius = EditorGUILayout.FloatField(_instance.radius.value, floatOptions);
|
||||
|
||||
// Close height
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Start the right for radius
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
// Draw the label
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Radius", smallText);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// Radius
|
||||
BBParameterEditor.ParameterField("", _instance.changeRadius);
|
||||
|
||||
if (_instance.changeRadius.value == ValueChangeAction.NewValue || _instance.changeRadius.value == ValueChangeAction.RelativeValue){
|
||||
// _instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
|
||||
BBParameterEditor.ParameterField("", _instance.radius);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeRadius.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// Close this line up
|
||||
|
||||
// Close easing
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.Space(8);
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
ValueGroupEditorUtilities.DrawEasingAndSmoothingSection(_instance);
|
||||
@@ -463,7 +455,7 @@ using UnityEngine;
|
||||
EditorGUILayout.TextField(_instance.changeSmoothing.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
|
||||
// Close easing
|
||||
GUILayout.EndVertical();
|
||||
|
||||
@@ -477,5 +469,14 @@ using UnityEngine;
|
||||
GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
|
||||
public static GUIStyle titleText = new GUIStyle{
|
||||
fontSize = 12,
|
||||
fontStyle = FontStyle.Bold,
|
||||
padding = new RectOffset(8, 0, 3,0),
|
||||
normal ={
|
||||
textColor = Color.white
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user