mirror of
https://github.com/unity-atoms/unity-atoms.git
synced 2025-01-22 08:08:51 -05:00
Merge pull request #201 from soraphis/canary-200-fix
#200 UnregisterAll did not unregister for listeners of OnEventNoValue (#201)
This commit is contained in:
commit
831312f4a4
@ -26,7 +26,7 @@ namespace UnityAtoms
|
||||
protected event Action<T> _onEvent;
|
||||
|
||||
/// <summary>
|
||||
/// The event replays the specified number of old values to new subscribers. Works like a ReplaySubject in Rx.
|
||||
/// The event replays the specified number of old values to new subscribers. Works like a ReplaySubject in Rx.
|
||||
/// </summary>
|
||||
[SerializeField]
|
||||
[Range(0, 10)]
|
||||
@ -97,8 +97,9 @@ namespace UnityAtoms
|
||||
/// <summary>
|
||||
/// Unregister all handlers that were registered using the `Register` method.
|
||||
/// </summary>
|
||||
public void UnregisterAll()
|
||||
public override void UnregisterAll()
|
||||
{
|
||||
base.UnregisterAll();
|
||||
_onEvent = null;
|
||||
}
|
||||
|
||||
|
@ -42,6 +42,14 @@ namespace UnityAtoms
|
||||
OnEventNoValue -= del;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unregister all handlers that were registered using the `Register` method.
|
||||
/// </summary>
|
||||
public virtual void UnregisterAll()
|
||||
{
|
||||
OnEventNoValue = null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Register a Listener that in turn trigger all its associated handlers when the Event triggers.
|
||||
/// </summary>
|
||||
@ -75,4 +83,4 @@ namespace UnityAtoms
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user