示例#1
0
 protected override void AddItem(EntityProcessor processor)
 {
     if (processor == null)
     {
         throw new ArgumentNullException(nameof(processor));
     }
     if (!Contains(processor))
     {
         if (preventPhysicsProcessor && processor.MainTypeName == "PhysicsComponent")
         {
             return; // don't use Bullet physics, bepu only!
         }
         base.AddItem(processor);
         manager.OnProcessorAdded(processor);
     }
 }
示例#2
0
        private void OnProcessorRemoved(EntityProcessor processor)
        {
            // Remove the procsesor from any list
            foreach (var componentTypeAndProcessors in MapComponentTypeToProcessors)
            {
                var processorList = componentTypeAndProcessors.Value;

                processorList.Remove(processor);
                if (processorList.Dependencies != null)
                {
                    processorList.Dependencies.Remove(processor);
                }
            }

            processor.RemoveAllEntities();

            processor.OnSystemRemove();
            processor.Services      = null;
            processor.EntityManager = null;
        }