using System.Numerics;
|
|
using Raylib_cs;
|
|
|
|
namespace Smoll.Ex2 {
|
|
class TimeToLiveComponent : Smoll.Component {
|
|
float secondsToLive;
|
|
float lived = 0f;
|
|
|
|
public TimeToLiveComponent(float secondsToLive)
|
|
{
|
|
this.secondsToLive = secondsToLive;
|
|
}
|
|
|
|
public override void Update(float deltaTimeSeconds)
|
|
{
|
|
lived += deltaTimeSeconds;
|
|
if(lived > secondsToLive) owner.mustDelete = true;
|
|
}
|
|
|
|
public override void Draw(Smoll.Layer.DrawMode drawMode) {
|
|
if(drawMode == Layer.DrawMode.Debug) {
|
|
}
|
|
}
|
|
}
|
|
}
|