internal static void RemoveComponent(IComponent component) { if (component == null) { throw new ArgumentNullException(nameof(component)); } foreach (var system in systems) { if (system is IWorldCallbackReceiver callbackReceiver) { callbackReceiver.OnDestroyingComponent(component); } } if (enableRegistries) { Registries.Remove(component); } components.Remove(component); }
internal static void AddComponent(IComponent component) { if (component == null) { throw new ArgumentNullException(nameof(component)); } components.Add(component); if (enableRegistries) { Registries.Add(component); } foreach (var system in systems) { if (system is IWorldCallbackReceiver callbackReceiver) { callbackReceiver.OnCreatedComponent(component); } } }