PhysicalEntity2D LifeTime Property Delta Engine Documentation

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

public float LifeTime { get; set; }

Property Value

Type: Single
Remarks

Tests: DeltaEngine.Physics2D.Tests.Projectile2DTests
Examples

1 unit tests call DeltaEngine.Physics2D.PhysicalEntity2D.LifeTime
[Test, CloseAfterFirstFrame, Ignore]
public void ExceedingLifeTime()
{
    var exceeded = false;
    var bullet = CreateBullet(Vector2D.One, 0);
    bullet.LifeTime = 0.1f;
    bullet.OnLifeTimeExceeded += () => exceeded = true;
    AdvanceTimeAndUpdateEntities(0.4f);
    Assert.IsFalse(bullet.IsActive);
    Assert.IsTrue(exceeded);
} //ncrunch: no coverage end
See Also