change: more alterations to movement, settingvalues, valuegroup, etc.
This commit is contained in:
@@ -32,6 +32,10 @@ using UnityEngine;
|
||||
// Create the value/disabled information field
|
||||
if (_instance.changeValue.value == ValueChangeAction.NewValue){
|
||||
_instance.value = EditorGUILayout.Toggle(_instance.value.value, floatOptions);
|
||||
} else if (_instance.changeValue.value == ValueChangeAction.RelativeValue){
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField("Not Available", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeValue.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
@@ -176,8 +180,7 @@ using UnityEngine;
|
||||
BBParameterEditor.ParameterField("", _instance.changeValue);
|
||||
|
||||
// Create the value/disabled information field
|
||||
if (_instance.changeValue.value == ValueChangeAction.NewValue){
|
||||
// _instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
|
||||
if (_instance.changeValue.value == ValueChangeAction.NewValue || _instance.changeValue.value == ValueChangeAction.RelativeValue){
|
||||
BBParameterEditor.ParameterField("", _instance.value);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
@@ -187,65 +190,9 @@ using UnityEngine;
|
||||
|
||||
// Close this line up with the variables
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// Start the smoothing and easing section
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
GUIStyle smallText= new GUIStyle{
|
||||
fontSize = 10,
|
||||
padding = new RectOffset(8, 0, 0,0),
|
||||
normal ={
|
||||
textColor = Color.gray
|
||||
}
|
||||
};
|
||||
|
||||
// Start the left side for easing
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
// Draw the label
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Easing", smallText);
|
||||
GUILayout.EndHorizontal();
|
||||
ValueGroupEditorUtilities.DrawEasingAndSmoothingSection(_instance);
|
||||
|
||||
// Easing
|
||||
_instance.changeEasing.value = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeEasing.value);
|
||||
if (_instance.changeEasing.value == ValueChangeAction.NewValue){
|
||||
// _instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
|
||||
BBParameterEditor.ParameterField("", _instance.easing);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeEasing.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// Close easing
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Start the right for smoothing
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
// Draw the label
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Smoothing", smallText);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// Easing
|
||||
_instance.changeSmoothing.value = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeSmoothing.value);
|
||||
if (_instance.changeSmoothing.value == ValueChangeAction.NewValue){
|
||||
// _instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
|
||||
BBParameterEditor.ParameterField("", _instance.smoothing);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeSmoothing.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// Close easing
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.Space(8);
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
// Reset to default so the rest of things don't get messed up
|
||||
EditorGUIUtility.labelWidth = 0;
|
||||
return _instance;
|
||||
@@ -323,6 +270,9 @@ using UnityEngine;
|
||||
|
||||
// Close this line up
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
ValueGroupEditorUtilities.DrawEasingAndSmoothingSection(_instance);
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Reset to default so the rest of things don't get messed up
|
||||
@@ -385,6 +335,9 @@ using UnityEngine;
|
||||
|
||||
// Close this line up
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
ValueGroupEditorUtilities.DrawEasingAndSmoothingSection(_instance);
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Reset to default so the rest of things don't get messed up
|
||||
@@ -445,10 +398,84 @@ using UnityEngine;
|
||||
|
||||
// Close this line up
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
ValueGroupEditorUtilities.DrawEasingAndSmoothingSection(_instance);
|
||||
|
||||
// Reset to default so the rest of things don't get messed up
|
||||
EditorGUIUtility.labelWidth = 0;
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ValueGroupEditorUtilities{
|
||||
public static void DrawEasingAndSmoothingSection(ValueGroup.ISmoothable _instance){
|
||||
// Start the smoothing and easing section
|
||||
GUILayout.BeginHorizontal();
|
||||
|
||||
GUIStyle smallText= new GUIStyle{
|
||||
fontSize = 10,
|
||||
padding = new RectOffset(8, 0, 0,0),
|
||||
normal ={
|
||||
textColor = Color.gray
|
||||
}
|
||||
};
|
||||
|
||||
// Start the left side for easing
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
// Draw the label
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Easing", smallText);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// Easing
|
||||
// _instance.changeEasing.value = (ValueChangeAction)EditorGUILayout.EnumPopup("", instance.changeEasing.value);
|
||||
BBParameterEditor.ParameterField("", _instance.changeEasing);
|
||||
|
||||
if (_instance.changeEasing.value == ValueChangeAction.NewValue){
|
||||
// _instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
|
||||
BBParameterEditor.ParameterField("", _instance.Easing);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeEasing.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// Close easing
|
||||
GUILayout.EndVertical();
|
||||
|
||||
// Start the right for smoothing
|
||||
GUILayout.BeginVertical();
|
||||
|
||||
// Draw the label
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("Smoothing", smallText);
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
// Smoothing
|
||||
BBParameterEditor.ParameterField("", _instance.changeSmoothing);
|
||||
|
||||
if (_instance.changeSmoothing.value == ValueChangeAction.NewValue){
|
||||
// _instance.value = EditorGUILayout.FloatField(_instance.value, floatOptions);
|
||||
BBParameterEditor.ParameterField("", _instance.Smoothing);
|
||||
} else {
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
EditorGUILayout.TextField(_instance.changeSmoothing.value == ValueChangeAction.NoChange ? "Unchanged" : "Reset", floatOptions);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
// Close easing
|
||||
GUILayout.EndVertical();
|
||||
|
||||
GUILayout.Space(8);
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
static GUILayoutOption[] floatOptions = new GUILayoutOption[] {
|
||||
GUILayout.Width(300.0f),
|
||||
GUILayout.MinWidth(20.0f),
|
||||
GUILayout.ExpandWidth(true),
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user