private EntityProcessor CreateRenderProcessor(RegisteredRenderProcessors registeredRenderProcessor, VisibilityGroup visibilityGroup) { // Create var processor = (EntityProcessor)Activator.CreateInstance(registeredRenderProcessor.Type); // Set visibility group ((IEntityComponentRenderProcessor)processor).VisibilityGroup = visibilityGroup; // Add processor Processors.Add(processor); registeredRenderProcessor.Instances.Add(new KeyValuePair<VisibilityGroup, EntityProcessor>(visibilityGroup, processor)); return processor; }
internal RenderObjectCollection(VisibilityGroup visibilityGroup) { this.visibilityGroup = visibilityGroup; }
public VisibilityGroup GetOrCreateVisibilityGroup(RenderSystem renderSystem) { // Find if it exists VisibilityGroup visibilityGroup = null; foreach (var currentVisibilityGroup in VisibilityGroups) { if (currentVisibilityGroup.RenderSystem == renderSystem) { visibilityGroup = currentVisibilityGroup; break; } } // If first time, let's create and register it if (visibilityGroup == null) VisibilityGroups.Add(visibilityGroup = new VisibilityGroup(renderSystem)); return visibilityGroup; }