mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-04-04 03:29:02 +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
|
// these properties in a closure
|
||||||
_menuItemOverrideProperty = prop;
|
_menuItemOverrideProperty = prop;
|
||||||
_menuItemOverrideTarget = mami;
|
_menuItemOverrideTarget = mami;
|
||||||
soc.OnStateOverrideChanged += MenuItemOverrideChanged;
|
soc.OnStateOverrideChanged = MenuItemOverrideChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MenuItemOverrideChanged(bool? obj)
|
private void MenuItemOverrideChanged(bool? obj)
|
||||||
@ -319,7 +319,7 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator
|
|||||||
|
|
||||||
_propertyOverrideProperty = property;
|
_propertyOverrideProperty = property;
|
||||||
_propertyOverrideTargetValue = targetValue;
|
_propertyOverrideTargetValue = targetValue;
|
||||||
soc.OnStateOverrideChanged += OnParameterOverrideChanged;
|
soc.OnStateOverrideChanged = OnParameterOverrideChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnParameterOverrideChanged(bool? state)
|
private void OnParameterOverrideChanged(bool? state)
|
||||||
@ -539,11 +539,11 @@ namespace nadena.dev.modular_avatar.core.editor.Simulator
|
|||||||
soc.SetWithoutNotify(menuOverride);
|
soc.SetWithoutNotify(menuOverride);
|
||||||
}
|
}
|
||||||
|
|
||||||
soc.OnStateOverrideChanged += value => { UpdateMenuItemOverride(prop, mami, value); };
|
soc.OnStateOverrideChanged = value => { UpdateMenuItemOverride(prop, mami, value); };
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
soc.OnStateOverrideChanged += value => UpdatePropertyOverride(prop, value, targetValue);
|
soc.OnStateOverrideChanged = value => UpdatePropertyOverride(prop, value, targetValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
var active = condition.InitiallyActive;
|
var active = condition.InitiallyActive;
|
||||||
|
@ -16,7 +16,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
|||||||
|
|
||||||
private static StyleSheet uss;
|
private static StyleSheet uss;
|
||||||
private Button btn_disable, btn_default, btn_enable;
|
private Button btn_disable, btn_default, btn_enable;
|
||||||
public event System.Action<bool?> OnStateOverrideChanged;
|
public System.Action<bool?> OnStateOverrideChanged;
|
||||||
|
|
||||||
public StateOverrideController()
|
public StateOverrideController()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user