protected override void UpdateEntity(float dt, Entity entity)
 {
     var position = entity.Get<Position>();
     var prev = entity.Get<PreviousPosition>();
     position.X.CopyTo(prev.X, 0);
     position.Y.CopyTo(prev.Y, 0);
 }
Example #2
0
 public static void Assign(this UpdatePositionMsg msg, Entity entity)
 {
     msg.Id = entity.Id;
     msg.X = entity.Get<Pos>().X;
     msg.Y = entity.Get<Pos>().Y;
     msg.Dir = entity.Get<Motion>().Dir;
     msg.Speed = entity.Get<Motion>().Dir;
 }
Example #3
0
        public static Body GetEffectiveBody(Entity e)
        {
            var body = e.Get(Body);
            if (body == null) {
                return null;
            }

            var position = e.Get(Located.Position);
            return body.Offset(position);
        }
Example #4
0
        protected override void UpdateEntity(float dt, Entity entity)
        {
            var position = entity.Get<Position>();
            var direction = entity.Get<Direction>();

            for (int i = 0; i < entity.Count(); ++i)
            {
                position.X[i] += direction.X[i] * dt;
                position.Y[i] += direction.Y[i] * dt;
            }
        }
Example #5
0
        public static bool Kill(Entity zombie, Vector2? explosionVelocity)
        {
            const float LotsOfDamage = 1000 * 1000;
            zombie.Get<CHealth>().TakeDamage(LotsOfDamage);
            if (explosionVelocity.HasValue)
            {
                ZombieHelper.TriggerBloodExplosion(zombie.Transform, explosionVelocity.Value);
            }

            zombie.Get<CZombieInfo>().SetKillReason(KillReason.Instakill);
            return true;
        }
Example #6
0
	public static void Attach(Entity result, Property<Matrix> property = null)
	{
		AkGameObjectTracker tracker = result.Get<AkGameObjectTracker>();
		if (tracker == null)
		{
			tracker = new AkGameObjectTracker();
			result.Add(tracker);
			if (property == null)
				property = result.Get<Transform>().Matrix;
			tracker.Add(new Binding<Matrix>(tracker.Matrix, property));
		}
	}
Example #7
0
File: Tick.cs Project: ktj007/mmo
        internal void OnTick(Entity entity, TickMessage tick)
        {
            // 로그아웃 한 상태에서 Tickable이 남아있는 유저는 Tick을 수행하지 않도록 한다.
            if (entity.Has<Player>() && !entity.Get<Player>().Logged)
            {
                entity.Detach<Tickable>();
                return;
            }

            if (entity.Has<Fightable>())
            {
                var fightable = entity.Get<Fightable>();
                if (fightable.IsAlive)
                {
                    if (++fightable.RecoveryCurrentTick >= fightable.RecoveryTickCount)
                    {
                        var recovery = DataCenter.Instance.GetDatum<InteractTemplate>((int)InteractTemplate.Ids.Recovery);
                        EffectSystem.Affect(entity, recovery);

                        fightable.RecoveryCurrentTick = 0;
                    }
                }
            }

            if (entity.Has<Eatable>())
            {
            }

            if (entity.Has<EntityGenerate>())
            {
                var entityGenerate = entity.Get<EntityGenerate>();
                if (entityGenerate.IsGeneratable)
                {
                    if (entityGenerate.Resource >= entityGenerate.NeededResourceToGen)
                    {
                        // generate!

                        entityGenerate.Resource -= entityGenerate.NeededResourceToGen;
                    }

                    entityGenerate.Resource += entityGenerate.IncResource;
                }
            }

            // 다음 Tick을 요청한다.
            if (entity.Has<Tickable>())
            {
                var nextMsg = new TickMessage {Id = entity.Id};
                nextMsg.ExecuteDelayed(entity, entity.Get<Tickable>().Interval);
            }
        }
Example #8
0
 public static void Assign(this SpawnMsg msg, Entity entity)
 {
     msg.Id = entity.Id;
     msg.Name = entity.Get<Nameplate>().Name;
     Assign(msg.CharacterResource, entity);
     Assign(msg.UpdatePosition, entity);
 }
Example #9
0
        public override void Initialize()
        {
            this.RegisterSystems();

            FPSCamera camera = new FPSCamera(new Vector3(0f, 0f, 0f), Vector3.Zero,
                Blackboard.Get<GraphicsDevice>("GraphicsDevice").Viewport.AspectRatio, 0.05f, 100f);

            Entity fpscounter = new Entity();
            fpscounter.AddComponent(new Transform2DComponent() { Position = new Vector2(5, 150) });
            fpscounter.AddComponent(new FPSCounterComponent());
            fpscounter.AddComponent(new GUITextComponent());

            Entity pos = new Entity();
            pos.AddComponent(new PositionalTrackingComponent() { Target = camera.Get<Transform3DComponent>() });
            pos.AddComponent(new GUITextComponent());
            pos.AddComponent(new Transform2DComponent() { Position = new Vector2(5, 180) });

            Entity model = new Entity();
            model.AddComponent(new Transform3DComponent(new Vector3(0f, -1f, 2f)));
            model.Get<Transform3DComponent>().Rotation = new Vector3(0f, MathHelper.PiOver2, 3f*MathHelper.PiOver2);
            Model m = Blackboard.Get<ContentManager>("ContentManager").Load<Model>("dragon");
            model.AddComponent(new ModelComponent() { Model = m });

            this.AddEntity(model);
            this.AddEntity(pos);
            this.AddEntity(fpscounter);
            this.AddEntity(camera);
        }
Example #10
0
 public override void OnEntityAdded(Entity entity)
 {
     if (entity.ComponentTypes.Contains(typeof(InputComponent)))
     {
         _inputComponent = entity.Get<InputComponent>();
     }
 }
Example #11
0
        public static bool TakeDamage(Entity zombie, float damage, Vector2? explosionVelocity)
        {
            CHealth health = zombie.Get<CHealth>();
            if (!health.IsAlive)
            {
                return true;
            }

            IBoosterState boosterState = zombie.EntityWorld.Services.Get<IBoosterState>();
            bool killed = health.TakeDamage(damage * BoosterHelper.GetZombieDamageRedcutionMultiplier(boosterState));
            if (explosionVelocity.HasValue)
            {
                if (killed)
                {
                    ZombieHelper.TriggerBloodExplosion(zombie.Transform, explosionVelocity.Value);
                }
                else
                {
                    ZombieHelper.TriggerBloodSplatter(zombie.Transform, Vector2.Zero);
                }
            }

            if (killed)
            {
                zombie.Get<CZombieInfo>().SetKillReason(KillReason.Normal);
            }

            return killed;
        }
Example #12
0
        protected override void UpdateEntity(float dt, Entity entity)
        {
            if (entity.Count() == 0)
            {
                return;
            }
            var direction = entity.Get<Direction>();
            var position = entity.Get<Position>();
            var input = entity.Get<InputComponent>();
            var hotspots = entity.Get<Hotspots>();

            float accel = dt * 0.8f;
            if (input.Right)
            {
                direction.X[0] = direction.X[0] + accel * (24.0f - direction.X[0]);
            }
            if (input.Left)
            {
                direction.X[0] = direction.X[0] + accel * (-24.0f - direction.X[0]);
            }
            if (!(input.Left || input.Right))
            {
                if (hotspots.BottomHit[0])
                {
                    direction.X[0] = direction.X[0] + dt * (0 - direction.X[0]);
                }
                else
                {
                    direction.X[0] = direction.X[0] + dt * .1f * (0 - direction.X[0]);
                }
            }
            if (input.Jump && hotspots.BottomHit[0])
            {
                if (input.Down)
                {
                    direction.Y[0] = 1.5f;
                    entity.Transform(0, input.DroppingPlayer);
                    input.DroppingPlayer.Get<TypeChanger>().Transformation = entity;
                    input.DroppingPlayer.Get<TypeChanger>().TTL = 0.8f;
                }
                else
                {
                    direction.Y[0] = -32.0f;
                }
            }
        }
 public override void Update()
 {
     if(Game.IsRunning && Entity.Components.Get<UIComponent>(UIComponent.Key).Enabled)
     {
         castle = (from entities in SceneSystem.SceneInstance where entities.Name == "Castle" select entities).FirstOrDefault();
         ((TextBlock)Entity.Components.Get<UIComponent>(UIComponent.Key).RootElement.VisualChildren.ElementAt(4)).Text = "Złoto: " + ((CastleController)castle.Get<ScriptComponent>(ScriptComponent.Key).Scripts[0]).gold.ToString();
         ((TextBlock)Entity.Components.Get<UIComponent>(UIComponent.Key).RootElement.VisualChildren.ElementAt(5)).Text = "Zdrowie: " + ((CastleController)castle.Get<ScriptComponent>(ScriptComponent.Key).Scripts[0]).health.ToString();
         ((TextBlock)Entity.Components.Get<UIComponent>(UIComponent.Key).RootElement.VisualChildren.ElementAt(6)).Text = "Jednostki: " + ((CastleController)castle.Get<ScriptComponent>(ScriptComponent.Key).Scripts[0]).units.ToString();
         ((TextBlock)Entity.Components.Get<UIComponent>(UIComponent.Key).RootElement.VisualChildren.ElementAt(7)).Text = "Kilofy: " + ((CastleController)castle.Get<ScriptComponent>(ScriptComponent.Key).Scripts[0]).pickaxes.ToString();
         ((TextBlock)Entity.Components.Get<UIComponent>(UIComponent.Key).RootElement.VisualChildren.ElementAt(8)).Text = "Miecze: " + ((CastleController)castle.Get<ScriptComponent>(ScriptComponent.Key).Scripts[0]).swords.ToString();
         ((TextBlock)Entity.Components.Get<UIComponent>(UIComponent.Key).RootElement.VisualChildren.ElementAt(9)).Text = "Łuki: " + ((CastleController)castle.Get<ScriptComponent>(ScriptComponent.Key).Scripts[0]).bowArrows.ToString();
         ((TextBlock)Entity.Components.Get<UIComponent>(UIComponent.Key).RootElement.VisualChildren.ElementAt(10)).Text = "Różdżki " + ((CastleController)castle.Get<ScriptComponent>(ScriptComponent.Key).Scripts[0]).wands.ToString();
         //Keyboard Input
         if(Input.IsKeyReleased(Keys.Escape))
         {
             ((Game)Game).Exit();
         }
         if(Input.IsKeyReleased(Keys.K))
         {
             ProduceUnit("KILOF");
         }
         if(Input.IsKeyReleased(Keys.M))
         {
             ProduceUnit("MIECZ");
         }
         if(Input.IsKeyReleased(Keys.L))
         {
             ProduceUnit("ŁUK");
         }
         if(Input.IsKeyReleased(Keys.R))
         {
             ProduceUnit("RÓŻDŻKA");
         }
     }
 }
Example #14
0
        public override bool OnBulletHitCallback(UpdateContext updateContext, CBullet bullet, Entity entityHit)
        {
            if (entityHit.Get<CHealth>().IsAlive && ZombieHelper.TakeDamage(entityHit, updateContext.DeltaSeconds * 10f, null))
            {
                ZombieHelper.TriggerBloodExplosion(entityHit.Transform, Vector2.Zero);
            }

            return false;
        }
Example #15
0
        static void Main(string[] args)
        {
            ReplaceInFile("C:\\Users\\Javier\\Desktop\\hola.txt", "C:\\Users\\Javier\\Desktop\\hola3.txt", "las personas","el mundo");
            ///////////////////////////
            //Se prueba objeto entity
            ///////////////////////////

            //Método Set (no case sensitive)
            Entity e = new Entity();
            e.Set("Nombre", "Javier");
            e.Set("Nombre", "Alonso");
            e.Set("Apellido", "Alvarez");
            e.Set("edad", 20);
            e.Set("fecha_nacimiento", new DateTime(1992,2,2));

            //Método Get (no case sensitive)
            Console.WriteLine("Información de Javier:");
            Console.WriteLine("Nombre: " + (string)e.Get("Nombre"));
            Console.WriteLine("Apellido: " + (string)e.Get("apellido"));
            Console.WriteLine("Edad: " + (int)e.Get("edad"));
            Console.WriteLine("Fecha de Nacimiento: " + (DateTime)e.Get("fecha_nacimiento"));

            ///////////////////////////
            ///////////////////////////

            ManejadorBaseDatos.Instancia.EjecutarScript("AYA");
            ///////////////////////////
            //Se prueba DA
            ///////////////////////////

            // Prueba Carga XML con DA
            Entities sp = new XMLLoader().loadXML("C://Users//Javier//.netbeans//7.1.2//config//GF3//domain1//tmsite//da//da.xml");

            // Prueba Ejecutar SP con objeto entity
            Entity parametros = new Entity();
            parametros.Set("pID", 1);
            parametros.Set("pCarro","Toyota");
            parametros.Set("pNombre","Javier");

            ///////////////////////////
            ///////////////////////////

            Console.ReadKey();
        }
Example #16
0
	public static void Attach(Entity result, Property<Vector3> property)
	{
		AkGameObjectTracker tracker = result.Get<AkGameObjectTracker>();
		if (tracker == null)
		{
			tracker = new AkGameObjectTracker();
			result.Add(tracker);
			tracker.Add(new Binding<Matrix, Vector3>(tracker.Matrix, x => Microsoft.Xna.Framework.Matrix.CreateTranslation(x), property));
		}
	}
Example #17
0
 protected override void UpdateEntity(float dt, Entity entity)
 {
     var tc = entity.Get<TypeChanger>();
     if ((tc.TTL -= dt) <= 0)
     {
         for (int i = 0; i < entity.Count(); ++i)
         {
             entity.Transform(i, tc.Transformation);
         }
     }
 }
Example #18
0
 public void Emit(Entity e)
 {
     var weaponConfig = e.Get(WeaponConfiguration);
     if (weaponConfig != null) {
         foreach (var weapon in weaponConfig) {
             weapon.ForEach<IBulletEmitter>((c) => {
                 c.Emit(weapon, e);
             });
         }
     }
 }
        protected override void Initialize()
        {
            _player = this.EntityWorld.FindEntityByName(EntityNames.Player);
            _playerInfo = _player.Get<CPlayerInfo>();

            this.EntityWorld.SubscribeToMessage<ZombieKilledMessage>(this.OnZombieKilled);
            _passiveStats = this.EntityWorld.Services.Get<IPlayerPassiveStats>();
            if (_passiveStats.SpawnWithThreeLives)
            {
                _playerInfo.AddLife();
            }
        }
Example #20
0
        public Section AddBackgroundEntity(Entity backgroundEntity)
        {
            // Attach  it in ModelEntity
            RootEntity.AddChild(backgroundEntity);

            // Get length via its bounding box
            var modelComponent = backgroundEntity.Get<ModelComponent>().Model;
            var boundingBox = modelComponent.BoundingBox;

            Length += boundingBox.Maximum.Z - boundingBox.Minimum.Z;

            return this;
        }
Example #21
0
        public void Update(Entity e, KeyboardState s)
        {
            var v = Vector2.Zero;
            if (s.IsKeyDown(Keys.Left )) { v.X -= 1; }
            if (s.IsKeyDown(Keys.Right)) { v.X += 1; }
            if (s.IsKeyDown(Keys.Down )) { v.Y += 1; }
            if (s.IsKeyDown(Keys.Up   )) { v.Y -= 1; }

            if (v != Vector2.Zero) {
                v.Normalize();
            }

            e.Set(Located.Velocity, v * e.Get(MovementSpeed));
        }
        /// <summary>
        /// Factory method to create Section from a given BackgroundEntity
        /// </summary>
        /// <param name="backgroundEnt"></param>
        /// <param name="maxObstacleOverride">The maximum number of obstacle in the block level</param>
        /// <returns></returns>
        private Section CreateLevelBlock(Entity backgroundEnt, int? maxObstacleOverride = null)
        {
            // Reset position
            backgroundEnt.Transform.Position = Vector3.Zero;

            var levelBlock = new Section();
            var backgroundInfo = backgroundEnt.Get<BackgroundInfo>();
            levelBlock.AddBackgroundEntity(backgroundEnt).AddHoleRange(backgroundInfo.Holes);

            var len = levelBlock.Length;
            RandomAddObstacles(levelBlock, len, maxObstacleOverride ?? backgroundInfo.MaxNbObstacles);

            return levelBlock;
        }
Example #23
0
        /// <summary>
        /// Chaining method for adding an obstacle to this Section.
        /// It initializes bounding boxes and stores in Collidable Obstacles.
        /// </summary>
        /// <param name="obstacleEntity">The entity containing the obstacle</param>
        /// <param name="useSubBoundingBoxes">true to use the bounding boxes of the sub-meshes</param>
        /// <returns></returns>
        public Section AddObstacleEntity(Entity obstacleEntity, bool useSubBoundingBoxes)
        {
            // Attach it in ModelEntity
            RootEntity.AddChild(obstacleEntity);

            // Get and add bb to CollidableObstacles
            var modelComponent = obstacleEntity.Get<ModelComponent>();

            var collidableObstacle = new Obstacle { Entity = obstacleEntity };

            if (useSubBoundingBoxes)
            {
                // Use bounding boxes from parts of the obstacle.
                foreach (var mesh in modelComponent.Model.Meshes)
                {
                    var boundingBox = mesh.BoundingBox;
                    var nodeIndex = mesh.NodeIndex;
                    while (nodeIndex >= 0)
                    {
                        var node = modelComponent.Model.Skeleton.Nodes[nodeIndex];
                        var transform = node.Transform;
                        var matrix = Matrix.Transformation(Vector3.Zero, Quaternion.Identity, transform.Scale, Vector3.Zero, transform.Rotation, transform.Position);

                        Vector3.TransformNormal(ref boundingBox.Minimum, ref matrix, out boundingBox.Minimum);
                        Vector3.TransformNormal(ref boundingBox.Maximum, ref matrix, out boundingBox.Maximum);

                        nodeIndex = node.ParentIndex;
                    }

                    collidableObstacle.BoundingBoxes.Add(boundingBox);
                }
            }
            else
            {
                // Use bounding box of the whole model
                collidableObstacle.BoundingBoxes.Add(modelComponent.Model.BoundingBox); 
            }

            CollidableObstacles.Add(collidableObstacle);

            return this;
        }
        private bool ShouldEscape(Entity zombie, CGoldenGoblinAI goldenGoblinAI)
        {
            // is player too close?
            const float DistanceToStartEscape = SkypieaConstants.PixelsPerMeter * 3;
            if (Vector2.Distance(_playerTransform.Position, zombie.Transform.Position) < DistanceToStartEscape)
            {
                return true;
            }

            // is at last waypoint
            if (goldenGoblinAI.CurrentWaypointIndex >= goldenGoblinAI.Waypoints.Count)
            {
                return true;
            }

            // has golden goblin been hit too much?
            const float EscapeLifeBoundary = 0.6f; // awful name.. basically how much life must be taken (in %) for the goblin to start escaping?
            CHealth health = zombie.Get<CHealth>();
            return health.CurrentHealth < health.MaximumHealth * EscapeLifeBoundary;
        }
Example #25
0
        protected override async Task LoadContent()
        {
            await base.LoadContent();

            Window.AllowUserResizing = true;

            // Instantiate a scene with a single entity and model component
            var scene = new Scene();

            // Create a cube entity
            cubeEntity = new Entity();

            // Create a procedural model with a diffuse material
            var model = new Model();
            var material = Material.New(GraphicsDevice, new MaterialDescriptor
            {
                Attributes =
                {
                    Diffuse = new MaterialDiffuseMapFeature(new ComputeColor(Color.White)),
                    DiffuseModel = new MaterialDiffuseLambertModelFeature()
                }
            });
            model.Materials.Add(material);
            cubeEntity.Add(new ModelComponent(model));

            var modelDescriptor = new ProceduralModelDescriptor(new CubeProceduralModel());
            modelDescriptor.GenerateModel(Services, model);

            // Add the cube to the scene
            scene.Entities.Add(cubeEntity);

            // Create a camera entity and add it to the scene
            var cameraEntity = new Entity { new CameraComponent() };
            cameraEntity.Transform.Position = new Vector3(0, 0, 5);
            scene.Entities.Add(cameraEntity);

            // Create a light
            var lightEntity = new Entity()
            {
                new LightComponent()
            };

            lightEntity.Transform.Position = new Vector3(0, 0, 1);
            lightEntity.Transform.Rotation = Quaternion.RotationY(MathUtil.DegreesToRadians(45));
            scene.Entities.Add(lightEntity);

            // Create a graphics compositor
            var compositor = new SceneGraphicsCompositorLayers();

            bool isLDR = false;
            if (isLDR)
            {
                compositor.Master.Renderers.Add(new ClearRenderFrameRenderer());
                compositor.Master.Renderers.Add(new SceneCameraRenderer() {});
            }
            else
            {
                var layer = new SceneGraphicsLayer();
                var renderHDROutput = new LocalRenderFrameProvider { Descriptor = { Format = RenderFrameFormat.HDR, DepthFormat = RenderFrameDepthFormat.Shared} };
                layer.Output = renderHDROutput;
                layer.Renderers.Add(new ClearRenderFrameRenderer());
                layer.Renderers.Add(new SceneCameraRenderer());
                compositor.Layers.Add(layer);
                compositor.Master.Renderers.Add(new SceneEffectRenderer()
                {
                    Effect = new PostProcessingEffects()
                });
            }
            compositor.Cameras.Add(cameraEntity.Get<CameraComponent>());

            SceneSystem.SceneInstance = new SceneInstance(Services, scene);

            // Use this graphics compositor
            scene.Settings.GraphicsCompositor = compositor;

            // Create a scene instance
            SceneSystem.SceneInstance = new SceneInstance(Services, scene);
        }
Example #26
0
 private void FormEllipsePoints(Entity entity)
 {
     ellipsePoints = entity.Get<List<Vector2D>>();
     ellipsePoints.Clear();
     ellipsePoints.Add(center);
     for (int i = 0; i < pointsCount; i++)
         FormRotatedEllipsePoint(i);
     entity.Set(ellipsePoints);
 }
Example #27
0
 public void Draw(Entity e, SpriteBatch b)
 {
     b.DrawString(e.Get(Font), e.Get(Text), e.Get(Located.Position), Color.White);
 }
 protected override void Draw(GraphicsContext graphicsContext, Entity entity)
 {
     this.DrawThumbStick(graphicsContext, entity.Get<CVirtualThumbstick>());
 }
 private static string GetText(Entity entity)
 {
     return "Hold mouse still for " + entity.Get<MouseHoverTrigger>().Elapsed + " seconds.";
 }
Example #30
0
        protected override async Task LoadContent()
        {
            await base.LoadContent();

            Window.AllowUserResizing = true;

            await base.LoadContent();

            Window.AllowUserResizing = true;

            arial16 = Content.Load<SpriteFont>("DynamicFonts/Arial16");

            // Instantiate a scene with a single entity and model component
            var scene = new Scene();

            // Fixed size
            scene.Entities.Add(GetUIEntity(arial16, true, new Vector3(0, 0, 4)));
            scene.Entities.Add(GetUIEntity(arial16, true, new Vector3(-2, 1, 0)));
            scene.Entities.Add(GetUIEntity(arial16, true, new Vector3(2, 2, -2)));
            scene.Entities.Add(GetUIEntity(arial16, true, new Vector3(0, 1, 0)));
            scene.Entities.Add(GetUIEntity(arial16, true, new Vector3(0, 2, -2)));

            scene.Entities.Add(GetUIEntity(arial16, false, new Vector3(0, -0.3f, 4)));
            scene.Entities.Add(GetUIEntity(arial16, false, new Vector3(-2, 0, 0)));
            scene.Entities.Add(GetUIEntity(arial16, false, new Vector3(2, 1, -2)));


            // Create a camera entity and add it to the scene
            var cameraEntity = new Entity { new CameraComponent() };
            cameraEntity.Transform.Position = new Vector3(0, 0, 5);
            scene.Entities.Add(cameraEntity);

            // Create a graphics compositor
            var compositor = new SceneGraphicsCompositorLayers();

            bool isLDR = true;
            if (isLDR)
            {
                compositor.Master.Renderers.Add(new ClearRenderFrameRenderer());
                compositor.Master.Renderers.Add(new SceneCameraRenderer() { });
            }
            else
            {
                var layer = new SceneGraphicsLayer();
                var renderHDROutput = new LocalRenderFrameProvider { Descriptor = { Format = RenderFrameFormat.HDR, DepthFormat = RenderFrameDepthFormat.Shared } };
                layer.Output = renderHDROutput;
                layer.Renderers.Add(new ClearRenderFrameRenderer());
                layer.Renderers.Add(new SceneCameraRenderer());
                compositor.Layers.Add(layer);
                compositor.Master.Renderers.Add(new SceneEffectRenderer()
                {
                    Effect = new PostProcessingEffects()
                });
            }
            compositor.Cameras.Add(cameraEntity.Get<CameraComponent>());

            // Use this graphics compositor
            scene.Settings.GraphicsCompositor = compositor;

            // Create a scene instance
            SceneSystem.SceneInstance = new SceneInstance(Services, scene);
        }