using System;
namespace Prototype;
public sealed class TorchFlicker : Component
{
public float Phase { get; set; }
private PointLight _light;
protected override void OnStart() => _light = Components.Get<PointLight>();
protected override void OnUpdate()
{
if ( _light is null ) return;
var pulse = .88f + MathF.Sin( Time.Now * 9.3f + Phase ) * .08f + MathF.Sin( Time.Now * 17.7f + Phase * 2.1f ) * .04f;
_light.LightColor = new Color( 1f, .31f, .075f ) * (8.5f * pulse);
}
}