Пример #1
0
        public override void Initialize()
        {
            ServiceManager.EntityAdded += ServiceManagerOnEntityAdded;

            // Query for the players we don't want
            foreach (var entity in ServiceManager.EntityCollection.Entities)
            {
                if (entity.ID == GameGlobals.EntityID)
                {
                    continue;
                }

                var transformComponent = entity.GetComponent<TransformComponent>();

                var interpolator = new EntityInterpolator(transformComponent);
                _entityInterpolators.Add(entity.ID, interpolator);
            }
        }
Пример #2
0
        private void ServiceManagerOnEntityAdded(Entity entity)
        {
            var transform = entity.GetComponent<TransformComponent>();

            if (transform != null)
            {
                var interpolator = new EntityInterpolator(transform);
                _entityInterpolators.Add(entity.ID, interpolator);
            }
        }