mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-30 18:22:52 +08:00
fix: menu item override is not shown in sim for autoprop boolean toggles (#1104)
This commit is contained in:
parent
89b4c8f921
commit
acd6c50543
@ -172,10 +172,14 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
internal static ControlCondition AssignMenuItemParameter(
|
||||
ModularAvatarMenuItem mami,
|
||||
Dictionary<string, float> simulationInitialStates = null,
|
||||
IDictionary<string, ModularAvatarMenuItem> isDefaultOverrides = null)
|
||||
IDictionary<string, ModularAvatarMenuItem> isDefaultOverrides = null,
|
||||
bool? forceSimulation = null
|
||||
)
|
||||
{
|
||||
var isSimulation = (simulationInitialStates != null || forceSimulation == true);
|
||||
|
||||
var paramName = mami?.Control?.parameter?.name;
|
||||
if (mami?.Control != null && simulationInitialStates != null && ShouldAssignParametersToMami(mami))
|
||||
if (mami?.Control != null && isSimulation && ShouldAssignParametersToMami(mami))
|
||||
{
|
||||
paramName = mami.Control?.parameter?.name;
|
||||
if (string.IsNullOrEmpty(paramName)) paramName = "___AutoProp/" + mami.GetInstanceID();
|
||||
@ -187,9 +191,10 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
if (isDefault)
|
||||
{
|
||||
simulationInitialStates[paramName] = mami.Control.value;
|
||||
} else if (!simulationInitialStates.ContainsKey(paramName))
|
||||
}
|
||||
else
|
||||
{
|
||||
simulationInitialStates[paramName] = -999;
|
||||
simulationInitialStates?.TryAdd(paramName, -999);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator
|
||||
return;
|
||||
}
|
||||
|
||||
var prop = ParameterAssignerPass.AssignMenuItemParameter(mami)?.Parameter;
|
||||
var prop = ParameterAssignerPass.AssignMenuItemParameter(mami, forceSimulation: true)?.Parameter;
|
||||
if (prop == null)
|
||||
{
|
||||
elem.style.display = DisplayStyle.None;
|
||||
|
Loading…
Reference in New Issue
Block a user