mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-31 02:32:53 +08:00
fix: menu items with no default fail to generate animator controller parameter entries (#1105)
This commit is contained in:
parent
acd6c50543
commit
4fa0621655
@ -75,8 +75,10 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
{
|
{
|
||||||
if (condition.IsConstant) continue;
|
if (condition.IsConstant) continue;
|
||||||
|
|
||||||
if (!initialValues.ContainsKey(condition.Parameter) && condition.InitialValue > -999f)
|
if (!initialValues.TryGetValue(condition.Parameter, out var curVal) || curVal < -999f)
|
||||||
|
{
|
||||||
initialValues[condition.Parameter] = condition.InitialValue;
|
initialValues[condition.Parameter] = condition.InitialValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,8 +93,8 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
if (list.Count == 1)
|
if (list.Count == 1)
|
||||||
// If we have only a single entry, it's probably an on-off toggle, so we'll implicitly let 0
|
// If we have only a single entry, it's probably an on-off toggle, so we'll implicitly let 0
|
||||||
// be the 'unselected' default value
|
// be the 'unselected' default value (if this is not default)
|
||||||
defaultValue = 1;
|
defaultValue = list[0].isDefault ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashSet<int> usedValues = new();
|
HashSet<int> usedValues = new();
|
||||||
@ -115,9 +115,9 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
{
|
{
|
||||||
if (mami.automaticValue)
|
if (mami.automaticValue)
|
||||||
{
|
{
|
||||||
if (mami.isDefault)
|
if (list.Count == 1)
|
||||||
{
|
{
|
||||||
mami.Control.value = defaultValue;
|
mami.Control.value = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user