mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-21 23:58:49 -05:00
Fix ChangedOnOnEnable not triggered
When using an Event Reference Listener with a variable, GetOrCreateEvent() is sometimes called after TriggerInitialEvents(). This commit solves this issue.
This commit is contained in:
parent
c810df67f0
commit
3aa06a70a1
@ -179,12 +179,18 @@ namespace UnityAtoms
|
||||
/// </summary>
|
||||
public void TriggerInitialEvents()
|
||||
{
|
||||
if (Changed != null && _triggerChangedOnOnEnable)
|
||||
if (_triggerChangedOnOnEnable)
|
||||
{
|
||||
if (Changed == null)
|
||||
GetOrCreateEvent<E1>();
|
||||
|
||||
Changed.Raise(Value);
|
||||
}
|
||||
if (ChangedWithHistory != null && _triggerChangedWithHistoryOnOnEnable)
|
||||
if (_triggerChangedWithHistoryOnOnEnable)
|
||||
{
|
||||
if(ChangedWithHistory == null)
|
||||
GetOrCreateEvent<E2>();
|
||||
|
||||
var pair = default(P);
|
||||
pair.Item1 = _value;
|
||||
pair.Item2 = _oldValue;
|
||||
|
Loading…
Reference in New Issue
Block a user