Click or drag to resize
DigitalRuneParticleSystemRandom Property
Gets or sets the random number generator used by the particle system.

Namespace: DigitalRune.Particles
Assembly: DigitalRune.Particles (in DigitalRune.Particles.dll) Version: 1.4.0.0 (1.4.1.14427)
Syntax
[ContentSerializerAttribute(Optional = true)]
public Random Random { get; set; }

Property Value

Type: Random
The random number generator. (Must not be .)
Exceptions
ExceptionCondition
ArgumentNullExceptionvalue is .
Remarks

The random number generator is created on demand when the property getter is accessed for the first time. When particle systems are updated in parallel (see EnableMultithreading) each particle system needs to have its own random number generator because the class Random is not thread-safe!

When multiple particle systems are created in close succession, they may be initialized with the same random seed. This can lead to particle systems that behave similar and do not look random. If this is a problem, consider setting a random number generator with a carefully chosen seed.

See Also