Fixing #196 (EventReferenceListener null reference) (#199)

The EventReference isn't initialized as null anymore, but require a default constructor as generic constraint.
This commit is contained in:
Oliver Biwer 2020-11-06 22:08:40 +01:00 committed by GitHub
parent 77faff6637
commit 53b350e51a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ namespace UnityAtoms
[EditorIcon("atom-icon-orange")]
public abstract class AtomEventReferenceListener<T, E, ER, UER> : AtomBaseListener<T, E, UER>, IAtomListener<T>
where E : AtomEvent<T>
where ER : IGetEvent, ISetEvent
where ER : IGetEvent, ISetEvent, new()
where UER : UnityEvent<T>
{
/// <summary>
@ -26,6 +26,6 @@ namespace UnityAtoms
/// The Event Reference that we are listening to.
/// </summary>
[SerializeField]
private ER _eventReference = default(ER);
private ER _eventReference = new ER();
}
}