Fix HipsTarget animator setting not being persistent
This commit is contained in:
parent
165378cb6e
commit
e09ad0b2e3
@ -110,6 +110,7 @@ namespace Passer {
|
||||
}
|
||||
|
||||
#region Sensors
|
||||
|
||||
public bool showSensors = true;
|
||||
private void SensorInspectors(HipsTarget hipsTarget) {
|
||||
showSensors = EditorGUILayout.Foldout(showSensors, "Controllers", true);
|
||||
@ -119,11 +120,24 @@ namespace Passer {
|
||||
foreach (TargetProps props in allProps)
|
||||
props.Inspector();
|
||||
|
||||
if (humanoid.animatorEnabled)
|
||||
hipsTarget.torsoAnimator.enabled = EditorGUILayout.ToggleLeft("Procedural Animation", hipsTarget.torsoAnimator.enabled, GUILayout.MinWidth(80));
|
||||
AnimatorInspector(hipsTarget);
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
|
||||
private void AnimatorInspector(HipsTarget hipsTarget) {
|
||||
SerializedProperty animatorProp = serializedObject.FindProperty(nameof(HipsTarget.torsoAnimator) + "." + nameof(HipsTarget.torsoAnimator.enabled));
|
||||
if (animatorProp == null || hipsTarget.humanoid == null || hipsTarget.humanoid.animatorEnabled)
|
||||
return;
|
||||
|
||||
GUIContent text = new GUIContent(
|
||||
"Procedural Animation",
|
||||
"Controls the hips when no tracking is active"
|
||||
);
|
||||
animatorProp.boolValue = EditorGUILayout.ToggleLeft(text, animatorProp.boolValue, GUILayout.MinWidth(80));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Configuration
|
||||
|
@ -57,6 +57,9 @@ namespace Passer.Humanoid {
|
||||
|
||||
#region Sensors
|
||||
|
||||
/// <summary>
|
||||
/// Controls the hips when no tracking is active
|
||||
/// </summary>
|
||||
public TorsoAnimator torsoAnimator = new TorsoAnimator();
|
||||
public override Passer.Sensor animator { get { return torsoAnimator; } }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user