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