/// <summary> /// Creates a new Particle. /// </summary> /// <param name="alphaValueFunc">Alpha value function to use. If null, uses alpha value of 1.0f.</param> public Particle(ParticleTextureData textureData, Vector2 position, Vector2 velocity, float angleRads, float angularVelocity, Color color, float size, float sizeChangeRatePerSecond, float timeToLive, AlphaValueDelegate alphaValueFunc = null) { Reset(textureData, position, velocity, angleRads, angularVelocity, color, size, sizeChangeRatePerSecond, timeToLive, alphaValueFunc); }
/// <summary> /// Resets a Particle for reuse. /// </summary> /// /// <param name="alphaValueFunc">Alpha value function to use. If null, uses alpha value of 1.0f.</param> public void Reset(ParticleTextureData textureData, Vector2 position, Vector2 velocity, float angleRads, float angularVelocity, Color color, float size, float sizeChangeRatePerSecond, float timeToLive, AlphaValueDelegate alphaValueFunc = null) { this.TextureData = textureData; this.Position = position; this.Velocity = velocity; this.AngleRads = angleRads; this.AngularVelocityRads = angularVelocity; this.Color = color; this.Size = size; this.SizeChangeRatePerSecond = sizeChangeRatePerSecond; this.TimeToLive = timeToLive; this.alphaValueFunction = alphaValueFunc; TimeAlive = 0.0f; }