示例#1
0
        /// <summary>
        /// Emit new particles and update the existing
        /// </summary>
        public override void Update()
        {
            if (IsEmitting)
            {
                // compute a random position of the level
                Vector3 position = transform.position;
                position.X += MathHelper.Lerp(_minX, _maxX, MyRandom.Value);
                position.Y += MathHelper.Lerp(_minHeight, _maxHeight, MyRandom.Value);
                position.Z += MathHelper.Lerp(_minZ, _maxZ, MyRandom.Value);

                // compute a random velocity
                Vector3 velocity = Vector3.Zero;
                velocity.X += MathHelper.Lerp(_minXV, _maxXV, MyRandom.Value);
                velocity.Z += MathHelper.Lerp(_minZV, _maxZV, MyRandom.Value);
                // falling down
                velocity.Y -= MathHelper.Lerp(_minYV, _maxYV, MyRandom.Value);

                _cashParticles.AddParticles(position, velocity);
                _particlesCreated++;
            }

            // only emitted in the beginning till the max number is created
            if (_particlesCreated > _maxParticles)
            {
                IsEmitting = false;
            }

            _cashParticles.Update();
        }
示例#2
0
        /// <summary>
        /// Emit new particles and update the existing
        /// </summary>
        public override void Update()
        {
            if (IsEmitting)
            {
                _smokePlumeParticles.AddParticles(transform.position, Vector3.Zero);
            }

            _smokePlumeParticles.Update();
        }
示例#3
0
        /// <summary>
        /// Emit new particles and update the existing
        /// </summary>
        public override void Update()
        {
            if (IsEmitting)
            {
                _cashDropParticles.AddParticles(transform.position, Vector3.Zero);
            }

            _cashDropParticles.Update();
        }