private void Remove(CameraComponent camera) { if (_cameras.Remove(camera)) { camera.EnabledChanged -= OnCameraEnabledChanged; camera.DrawOrderChanged -= OnCameraDrawOrderChanged; camera.Destroyed -= OnCameraComponentDestroyed; if (camera.Enabled) { _enabledCameras.Remove(camera); } } }
public void OnComponentDestroyed(IComponent component) { if (component is SkiUiComponent uiComponent) { _components.Remove(uiComponent); } }
public void OnComponentDestroyed(IComponent component) { if (_currentlyUpdating) { _componentsToRemove.Add(component); } else if (component is IUpdateableComponent updateableComponent) { _layeredUpdateableParts.Remove(updateableComponent.UpdateablePart); updateableComponent.UpdateablePart.UpdateOrderChanged -= PartUpdateOrderChanged; } }