Exemple #1
0
        public void InvokeCallbacks()
        {
            var entities = entitySystem.GetEntitiesRemoved();

            for (int i = 0; i < entities.Count; ++i)
            {
                callbacks.InvokeAllReverse(entities[i]);
            }
        }
        public void InvokeCallbacks()
        {
            var entities = entitySystem.GetEntitiesRemoved();

            foreach (var entityId in entities)
            {
                callbacks.InvokeAllReverse(entityId);
            }
        }
        protected override void OnUpdate()
        {
            foreach (var entityId in entitySystem.GetEntitiesAdded())
            {
                foreach (var manager in managers)
                {
                    workerSystem.TryGetEntity(entityId, out var entity);
                    manager.AddComponents(entity, EntityManager, World);
                }
            }

            foreach (var entityId in entitySystem.GetEntitiesRemoved())
            {
                foreach (var manager in managers)
                {
                    manager.RemoveComponents(entityId, EntityManager, World);
                }
            }
        }
        protected override void OnUpdate()
        {
            foreach (var entityId in entitySystem.GetEntitiesAdded())
            {
                workerSystem.TryGetEntity(entityId, out var entity);
                gameObjectCreator.OnEntityCreated(new SpatialOSEntity(entity, EntityManager), Linker);
            }

            var removedEntities = entitySystem.GetEntitiesRemoved();

            foreach (var entityId in removedEntities)
            {
                Linker.UnlinkAllGameObjectsFromEntityId(entityId);
            }

            Linker.FlushCommandBuffer();

            foreach (var entityId in removedEntities)
            {
                gameObjectCreator.OnEntityRemoved(entityId);
            }
        }