public override void AttachEditorComponents(Entity entity, Main main)
        {
            ModelAlpha model = new ModelAlpha();

            model.Filename.Value = "AlphaModels\\light";
            model.Color.Value    = this.Color;
            model.Serialize      = false;
            model.Scale.Value    = new Vector3(1, 1, -1);
            model.Add(new Binding <Matrix>(model.Transform, entity.Get <Transform>().Matrix));
            entity.Add("EditorModel", model);
            model.Add(new Binding <bool>(model.Enabled, Editor.EditorModelsVisible));

            VoxelAttachable.AttachEditorComponents(entity, main);

            ModelAlpha offsetModel = new ModelAlpha();

            offsetModel.Filename.Value = "AlphaModels\\cone";
            offsetModel.Add(new Binding <Vector3>(offsetModel.Color, model.Color));

            CameraStop cameraStop = entity.Get <CameraStop>();

            offsetModel.Add(new Binding <bool>(offsetModel.Enabled, () => entity.EditorSelected && cameraStop.Offset != 0 && Editor.EditorModelsVisible, entity.EditorSelected, cameraStop.Offset, Editor.EditorModelsVisible));
            offsetModel.Add(new Binding <Vector3, float>(offsetModel.Scale, x => new Vector3(1, 1, x), cameraStop.Offset));
            offsetModel.Add(new Binding <Matrix>(offsetModel.Transform, model.Transform));
            offsetModel.Serialize = false;
            entity.Add("EditorModel3", offsetModel);

            EntityConnectable.AttachEditorComponents(entity, "Next", cameraStop.Next);
        }
Exemple #2
0
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            base.AttachEditorComponents(entity, main);

            VoxelAttachable.AttachEditorComponents(entity, main, entity.Get <Model>().Color);
            PlayerTrigger.AttachEditorComponents(entity, main, entity.Get <Model>().Color);
        }
Exemple #3
0
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            base.AttachEditorComponents(entity, main);
            Model editorModel = entity.Get <Model>("EditorModel");

            editorModel.Add(new Binding <bool>(editorModel.Enabled, () => Editor.EditorModelsVisible && !entity.EditorSelected, Editor.EditorModelsVisible, entity.EditorSelected));
            VoxelAttachable.AttachEditorComponents(entity, main, editorModel.Color);
        }
Exemple #4
0
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            base.AttachEditorComponents(entity, main);

            VoxelAttachable.AttachEditorComponents(entity, main, entity.Get <Model>().Color);

            EntityConnectable.AttachEditorComponents(entity, "Target", entity.Get <VoxelFill>().Target);
        }
Exemple #5
0
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            base.AttachEditorComponents(entity, main);

            Rift.AttachEditorComponents(entity, main, this.Color);

            VoxelAttachable.AttachEditorComponents(entity, main, entity.Get <Model>().Color);
        }
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            base.AttachEditorComponents(entity, main);
            Model           editorModel = entity.Get <Model>("EditorModel");
            ParticleEmitter emitter     = entity.Get <ParticleEmitter>();

            editorModel.Add(new Binding <bool>(editorModel.Enabled, () => Editor.EditorModelsVisible && (!entity.EditorSelected || emitter.ParticleType.Value == null), entity.EditorSelected, emitter.ParticleType, Editor.EditorModelsVisible));

            VoxelAttachable.AttachEditorComponents(entity, main, editorModel.Color);
        }
Exemple #7
0
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            base.AttachEditorComponents(entity, main);
            Model model = entity.Get <Model>("EditorModel");

            Property <Vector3> color = entity.Get <PointLight>().Color;

            model.Add(new Binding <Vector3>(model.Color, color));
            model.Add(new Binding <bool>(model.Enabled, Editor.EditorModelsVisible));

            VoxelAttachable.AttachEditorComponents(entity, main, color);
        }
Exemple #8
0
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            ModelAlpha model = new ModelAlpha();

            model.Filename.Value = "AlphaModels\\light";
            model.Color.Value    = this.Color;
            model.Serialize      = false;

            entity.Add("EditorModel", model);

            model.Add(new Binding <Matrix>(model.Transform, entity.Get <Transform>().Matrix));
            model.Add(new Binding <bool>(model.Enabled, Editor.EditorModelsVisible));

            PlayerTrigger.AttachEditorComponents(entity, main, this.Color);
            VoxelAttachable.AttachEditorComponents(entity, main);
        }
Exemple #9
0
        public override void AttachEditorComponents(Entity entity, Main main)
        {
            ModelAlpha model = new ModelAlpha();

            model.Filename.Value = "AlphaModels\\light";
            Property <Vector3> color = entity.Get <SpotLight>().Color;

            model.Add(new Binding <Vector3>(model.Color, color));
            model.Serialize = false;
            model.Add(new Binding <bool>(model.Enabled, Editor.EditorModelsVisible));

            entity.Add("EditorModel", model);

            model.Add(new Binding <Matrix>(model.Transform, delegate(Matrix x)
            {
                x.Forward *= -1;
                return(x);
            }, entity.Get <Transform>().Matrix));

            VoxelAttachable.AttachEditorComponents(entity, main, color);
        }