Beispiel #1
0
        protected override EffectTypeModuleData CreateInstanceForClone()
        {
            FireworksData result = new FireworksData
            {
                Velocity             = Velocity,
                MinVelocity          = MinVelocity,
                MaxVelocity          = MaxVelocity,
                LevelCurve           = new Curve(LevelCurve),
                ParticleFade         = ParticleFade,
                RandomParticles      = RandomParticles,
                Explosions           = Explosions,
                ColorType            = ColorType,
                Particles            = Particles,
                MinParticles         = MinParticles,
                MaxParticles         = MaxParticles,
                Sensitivity          = Sensitivity,
                RandomVelocity       = RandomVelocity,
                ColorGradients       = ColorGradients.ToList(),
                LowPass              = LowPass,
                LowPassFreq          = LowPassFreq,
                HighPass             = HighPass,
                HighPassFreq         = HighPassFreq,
                Normalize            = Normalize,
                DecayTime            = DecayTime,
                AttackTime           = AttackTime,
                ExplosionSensitivity = ExplosionSensitivity,
                MarkCollectionId     = MarkCollectionId,
                FireworksSource      = FireworksSource
            };

            return(result);
        }
 protected override bool OnAttachBuffers(DeviceContextProxy context, ref int vertStartSlot)
 {
     if (base.OnAttachBuffers(context, ref vertStartSlot))
     {
         if (colorChanged)
         {
             RemoveAndDispose(ref colorGradientResource);
             if (ColorGradients != null)
             {
                 colorGradientResource = new ShaderResourceViewProxy(Device);
                 colorGradientResource.CreateViewFromColorArray(ColorGradients.ToArray());
             }
             colorChanged = false;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }