Beispiel #1
0
        /// <summary>
        /// Forcibly kills the effect.
        /// </summary>
        /// <param name="immediate">If true, the effect will be killed immediately and <see cref="IsAlive"/> will be
        /// false by the time the method returns. If false, the effect is allowed to enter itself into a "terminating" state,
        /// allowing it to cleanly transition the effect out.</param>
        public virtual void Kill(bool immediate)
        {
            if (!IsAlive)
            {
                return;
            }

            _isAlive = false;

            if (Died != null)
            {
                Died.Raise(this, EventArgs.Empty);
            }
        }
        /// <summary>
        /// Forcibly kills the effect.
        /// </summary>
        /// <param name="immediate">If true, the particle effect will stop emitting and existing particles will be given time
        /// to expire.</param>
        public void Kill(bool immediate)
        {
            if (!IsAlive)
            {
                return;
            }

            _particleEffect.Kill();

            if (!immediate)
            {
                return;
            }

            _isAlive = false;

            if (Died != null)
            {
                Died.Raise(this, EventArgs.Empty);
            }
        }