/// <inheritdoc />
        public void RemoveEntity(RemoveEntityPipelineOp removeEntityOp)
        {
            var entityId = removeEntityOp.EntityId;

            if (IsEntityQueued(entityId))
            {
                entityActions[entityId].Enqueue(removeEntityOp);
            }
            else
            {
                NextEntityBlock.RemoveEntity(removeEntityOp);
            }
        }
        /// <inheritdoc />
        public void RemoveEntity(RemoveEntityPipelineOp removeEntityOp)
        {
            if (!IsEntityTracked(removeEntityOp.EntityId))
            {
                Debug.LogErrorFormat("Trying to destroy an entity we don't have: {0}", removeEntityOp.EntityId);
                return;
            }

            metrics.DecrementGauge(EntityCountGaugeName);

            if (universe.ContainsEntity(removeEntityOp.EntityId))
            {
                NextEntityBlock.RemoveEntity(removeEntityOp);
                var entity = universe.Get(removeEntityOp.EntityId);
                DestroyEntity(entity);
            }

            if (entitiesToSpawn.ContainsKey(removeEntityOp.EntityId))
            {
                entitiesToSpawn.Remove(removeEntityOp.EntityId);
            }

            knownEntities.Remove(removeEntityOp.EntityId);
        }
Example #3
0
 /// <inheritdoc />
 public void RemoveEntity(RemoveEntityPipelineOp removeEntityOp)
 {
     StallForCriticalSection(removeEntityOp);
 }