public void Subscribe(ref Entity entity, IComponentRemovedFromEntityEventListener eventListener) { List <IComponentRemovedFromEntityEventListener> eventListeners; if (!eventListenerMap.TryGetValue(entity, out eventListeners)) { eventListeners = new List <IComponentRemovedFromEntityEventListener>(); eventListenerMap.Add(entity, eventListeners); } eventListeners.Add(eventListener); }
public void Unsubscribe(ref Entity entity, IComponentRemovedFromEntityEventListener eventListener) { List <IComponentRemovedFromEntityEventListener> eventListeners; if (eventListenerMap.TryGetValue(entity, out eventListeners)) { eventListeners.Remove(eventListener); if (eventListeners.Count == 0) { eventListenerMap.Remove(entity); } } }
public void UnsubscribeOnComponentRemovedFromEntity(IComponentRemovedFromEntityEventListener eventListener) { _componentRemovedFromEntityEvent.Unsubscribe(eventListener); }
public void SubscribeOnComponentRemovedFromEntity(Entity entity, IComponentRemovedFromEntityEventListener eventListener) { _componentRemovedFromEntityEvent.Subscribe(ref entity, eventListener); }
public void UnsubscribeOnComponentRemovedFromEntity <TComponent>(IComponentRemovedFromEntityEventListener <TComponent> eventListener) where TComponent : IComponent { GetComponentMap <TComponent>(true).UnsubscribeOnComponentRemovedFromEntity(eventListener); }
public void SubscribeOnComponentRemovedFromEntity <TComponent>(Entity entity, IComponentRemovedFromEntityEventListener <TComponent> eventListener) where TComponent : IComponent { GetComponentMap <TComponent>(true).SubscribeOnComponentRemovedFromEntity(entity, eventListener); }
public void UnsubscripeOnComponentRemovedFromEntity(Entity entity, IComponentRemovedFromEntityEventListener eventListener) { _componentRemovedFromEntityEvent.Unsubscripe(ref entity, eventListener); }