public override Entity Create(Main main)
        {
            Entity result = new Entity(main, "PlayerTrigger");

            Transform position = new Transform();

            PlayerTrigger trigger = new PlayerTrigger();
            trigger.Radius.Value = 10.0f;
            result.Add("PlayerTrigger", trigger);

            result.Add("Position", position);

            return result;
        }
Example #2
0
        public static void AttachEditorComponents(Entity entity, Main main, Vector3 color)
        {
            Transform transform = entity.Get <Transform>();

            ModelAlpha model = new ModelAlpha();

            model.Filename.Value       = "AlphaModels\\sphere";
            model.Alpha.Value          = 0.15f;
            model.Color.Value          = color;
            model.DisableCulling.Value = true;
            PlayerTrigger trigger = entity.Get <PlayerTrigger>();

            model.Add(new Binding <Vector3, float>(model.Scale, x => new Vector3(x), trigger.Radius));
            model.DrawOrder.Value = 11;             // In front of water
            model.Add(new Binding <bool>(model.Enabled, () => entity.EditorSelected, entity.EditorSelected));

            entity.Add(model);

            model.Add(new Binding <Matrix, Vector3>(model.Transform, x => Matrix.CreateTranslation(x), transform.Position));
        }
Example #3
0
        public override Entity Create(Main main)
        {
            Entity result = new Entity(main, "MapExit");

            Transform position = new Transform();

            PlayerTrigger trigger = new PlayerTrigger();
            trigger.Radius.Value = 10.0f;
            result.Add("PlayerTrigger", trigger);

            result.Add("Transform", position);

            result.Add("NextMap", new Property<string> { Editable = true });
            result.Add("SpawnPoint", new Property<string> { Editable = true });

            return result;
        }