Entity Dispose Method Delta Engine Documentation

Namespace: DeltaEngine.Entities
Assembly: DeltaEngine (in DeltaEngine.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public virtual void Dispose()

Implements

IDisposable Dispose 
Remarks

Tests: DeltaEngine.Rendering3D.Particles.Tests.ParticleSystemTests
Examples

2 unit tests call DeltaEngine.Entities.Entity.Dispose
[Test, CloseAfterFirstFrame]
public void DisposeEmitterDeactivates()
{
    var emitterAlpha = CreateAndAttachEmitter(Vector3D.Zero);
    var emitterBeta = CreateAndAttachEmitter(Vector3D.UnitY);
    particleSystem.DisposeEmitter(1);
    particleSystem.DisposeEmitter(emitterAlpha);
    particleSystem.DisposeEmitter(emitterAlpha);
    Assert.IsFalse(emitterAlpha.IsActive);
    Assert.IsFalse(emitterBeta.IsActive);
    Assert.AreEqual(0, particleSystem.AttachedEmitters.Count);
}
[Test, CloseAfterFirstFrame]
public void DisposingSystemDisposesAllEmitters()
{
    var emitterAlpha = CreateAndAttachEmitter(Vector3D.Zero);
    var emitterBeta = CreateAndAttachEmitter(Vector3D.UnitY);
    particleSystem.DisposeSystem();
    Assert.IsFalse(emitterAlpha.IsActive);
    Assert.IsFalse(emitterBeta.IsActive);
}
See Also