mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: ROSimulator registers multiple event handlers for state override buttons (#1203)
This commit is contained in:
parent
bf47a4c544
commit
51fedbd9b0
@ -286,7 +286,7 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator
|
||||
// these properties in a closure
|
||||
_menuItemOverrideProperty = prop;
|
||||
_menuItemOverrideTarget = mami;
|
||||
soc.OnStateOverrideChanged += MenuItemOverrideChanged;
|
||||
soc.OnStateOverrideChanged = MenuItemOverrideChanged;
|
||||
}
|
||||
|
||||
private void MenuItemOverrideChanged(bool? obj)
|
||||
@ -319,7 +319,7 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator
|
||||
|
||||
_propertyOverrideProperty = property;
|
||||
_propertyOverrideTargetValue = targetValue;
|
||||
soc.OnStateOverrideChanged += OnParameterOverrideChanged;
|
||||
soc.OnStateOverrideChanged = OnParameterOverrideChanged;
|
||||
}
|
||||
|
||||
private void OnParameterOverrideChanged(bool? state)
|
||||
@ -539,11 +539,11 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator
|
||||
soc.SetWithoutNotify(menuOverride);
|
||||
}
|
||||
|
||||
soc.OnStateOverrideChanged += value => { UpdateMenuItemOverride(prop, mami, value); };
|
||||
soc.OnStateOverrideChanged = value => { UpdateMenuItemOverride(prop, mami, value); };
|
||||
}
|
||||
else
|
||||
{
|
||||
soc.OnStateOverrideChanged += value => UpdatePropertyOverride(prop, value, targetValue);
|
||||
soc.OnStateOverrideChanged = value => UpdatePropertyOverride(prop, value, targetValue);
|
||||
}
|
||||
|
||||
var active = condition.InitiallyActive;
|
||||
|
@ -16,7 +16,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
|
||||
private static StyleSheet uss;
|
||||
private Button btn_disable, btn_default, btn_enable;
|
||||
public event System.Action<bool?> OnStateOverrideChanged;
|
||||
public System.Action<bool?> OnStateOverrideChanged;
|
||||
|
||||
public StateOverrideController()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user