Exemple #1
0
        /// <summary>
        /// Creates a deep copy of this <see cref="ParticleEmitter"/> instance.
        /// </summary>
        /// <returns>A deep copy of this <see cref="ParticleEmitter"/>.</returns>
        public override ParticleEmitter DeepCopy(IParticleEffect newOwner)
        {
            var ret = new PointEmitter(newOwner);

            CopyValuesTo(ret);
            return(ret);
        }
Exemple #2
0
 /// <summary>
 /// Creates a deep copy of this <see cref="ParticleEmitter"/> instance.
 /// </summary>
 /// <returns>A deep copy of this <see cref="ParticleEmitter"/>.</returns>
 public override ParticleEmitter DeepCopy(IParticleEffect newOwner)
 {
     var ret = new PointEmitter(newOwner);
     CopyValuesTo(ret);
     return ret;
 }
        /// <summary>
        /// Handles the Click event of the btnNewEmitter control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void btnNewEmitter_Click(object sender, EventArgs e)
        {
            // Ensure a valid ParticleEffect is selected
            var pe = ParticleEffect;
            if (pe == null)
                return;

            // Add new emitter. Default to PointEmitter. Type can be changed by the user later.
            var emitter = new PointEmitter(pe);
            if (emitter.Sprite.GrhData == null && _defaultEmitterSprite != null)
                emitter.Sprite.SetGrh(_defaultEmitterSprite);

            if (!lstEmitters.Items.Contains(emitter))
                lstEmitters.Items.Add(emitter);

            lstEmitters.RebuildList(ParticleEffect);
            lstEmitters.SelectedItem = emitter;
        }