示例#1
0
        /// <summary>
        /// Updates <see cref="Komodo.Core.ECS.Systems.ISystem"/> objects.
        /// </summary>
        /// <param name="gameTime">Time passed since last <see cref="Update(GameTime)"/>.</param>
        public void Update(GameTime gameTime)
        {
            InputManager.Update();

            BehaviorSystem.PreUpdate(gameTime);
            CameraSystem.PreUpdate(gameTime);
            SoundSystem.PreUpdate(gameTime);
            var physicsSystems = PhysicsSystems.ToArray();

            foreach (var system in physicsSystems)
            {
                system.PreUpdate(gameTime);
            }
            var render3DSystems = Render3DSystems.ToArray();

            foreach (var system in render3DSystems)
            {
                system.PreUpdate(gameTime);
            }
            var render2DSystems = Render2DSystems.ToArray();

            foreach (var system in render2DSystems)
            {
                system.PreUpdate(gameTime);
            }

            BehaviorSystem.UpdateComponents(gameTime);
            CameraSystem.UpdateComponents(gameTime);
            SoundSystem.UpdateComponents(gameTime);
            foreach (var system in physicsSystems)
            {
                system.UpdateComponents(gameTime);
            }

            BehaviorSystem.PostUpdate(gameTime);
            CameraSystem.PostUpdate(gameTime);
            SoundSystem.PostUpdate(gameTime);
            foreach (var system in physicsSystems)
            {
                system.PostUpdate(gameTime);
            }
            foreach (var system in render3DSystems)
            {
                system.PostUpdate(gameTime);
            }
            foreach (var system in render2DSystems)
            {
                system.PostUpdate(gameTime);
            }
        }