A Smoll game engine
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
626 B

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) {
}
}
}
}