Exemple #1
0
 public FlagToggleWaterfall(EntityData data, Vector2 offset) : base(data, offset)
 {
     Add(toggle = new FlagToggleComponent(data.Attr("flag"), data.Bool("inverted"), () => {
         // disable the waterfall sound.
         loopingSfx.Stop();
         enteringSfx.Stop();
     }, () => {
         // enable it again.
         loopingSfx.Play(loopingSfxEvent);
         enteringSfx.Play(enteringSfxEvent);
     }));
 }
Exemple #2
0
        public FlagToggleWater(EntityData data, Vector2 offset) : base(data, offset)
        {
            // look up the displacement renderer to be able to toggle it.
            DisplacementRenderHook displacementHook = null;

            foreach (Component component in this)
            {
                if (component is DisplacementRenderHook displacement)
                {
                    displacementHook = displacement;
                    break;
                }
            }

            // when the water is toggled, toggle the displacement as well.
            Add(toggle = new FlagToggleComponent(data.Attr("flag"), data.Bool("inverted"),
                                                 () => Remove(displacementHook), () => Add(displacementHook)));
        }
Exemple #3
0
 public FlagToggleStarTrackSpinner(EntityData data, Vector2 offset) : base(data, offset)
 {
     Add(toggle = new FlagToggleComponent(data.Attr("flag"), data.Bool("inverted")));
 }