where E2 : AtomEvent
where F : AtomFunction
{
///
/// Override to add implementation specific setup on `OnEnable`.
///
protected override void ImplSpecificSetup()
{
if (Base.Changed != null)
{
_inMemoryCopy.Changed = Instantiate(Base.Changed);
}
if (Base.ChangedWithHistory != null)
{
_inMemoryCopy.ChangedWithHistory = Instantiate(Base.ChangedWithHistory);
}
// Manually trigger initial events since base class has already instantiated Variable
// and the Variable's OnEnable hook has therefore already been executed.
_inMemoryCopy.TriggerInitialEvents();
}
///
/// Get event by type.
///
///
/// The event.
public E GetEvent() where E : AtomEventBase
{
return _inMemoryCopy.GetEvent();
}
///
/// Set event by type.
///
/// The new event value.
///
public void SetEvent(E e) where E : AtomEventBase
{
_inMemoryCopy.SetEvent(e);
}
///
/// Get event by type. Creates it if it doesn't exist.
///
///
/// The event.
public E GetOrCreateEvent() where E : AtomEventBase
{
return _inMemoryCopy.GetOrCreateEvent();
}
}
}