public void ReplaceFlagAddedAndRemovedEventListener(IFlagAddedAndRemovedEventListener newValue) { var index = TestComponentsLookup.FlagAddedAndRemovedEventListener; var component = CreateComponent <FlagAddedAndRemovedEventListenerComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public void AddFlagAddedAndRemovedEventListener(IFlagAddedAndRemovedEventListener value) { var listeners = hasFlagAddedAndRemovedEventListener ? flagAddedAndRemovedEventListener.value : new System.Collections.Generic.List <IFlagAddedAndRemovedEventListener>(); listeners.Add(value); ReplaceFlagAddedAndRemovedEventListener(listeners); }
public void RemoveFlagAddedAndRemovedEventListener(IFlagAddedAndRemovedEventListener value) { var listeners = flagAddedAndRemovedEventListener.value; listeners.Remove(value); if (listeners.Count == 0) { RemoveFlagAddedAndRemovedEventListener(); } else { ReplaceFlagAddedAndRemovedEventListener(listeners); } }