mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: can't unset the default value for bool parameter (#1121)
This commit is contained in:
parent
29177f2c5a
commit
38384a3c70
@ -12,6 +12,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
{
|
||||
}
|
||||
|
||||
private const string V_None = " ";
|
||||
private const string V_True = "ON";
|
||||
private const string V_False = "OFF";
|
||||
|
||||
@ -27,7 +28,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
_hasExplicitDefaultSetField = new Toggle();
|
||||
_boolField = new DropdownField();
|
||||
|
||||
_boolField.choices.Add("");
|
||||
_boolField.choices.Add(V_None);
|
||||
_boolField.choices.Add(V_True);
|
||||
_boolField.choices.Add(V_False);
|
||||
|
||||
@ -66,7 +67,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
else
|
||||
_defaultValueField.value = 0;
|
||||
|
||||
_hasExplicitDefaultSetField.value = evt.newValue != "";
|
||||
_hasExplicitDefaultSetField.value = evt.newValue != V_None;
|
||||
});
|
||||
|
||||
|
||||
@ -96,7 +97,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
string boolStr;
|
||||
if (!hasExplicitValue)
|
||||
boolStr = "";
|
||||
boolStr = V_None;
|
||||
else if (value > 0.5)
|
||||
boolStr = V_True;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user