local obj = nil
local light = nil
local hue = 0.0

function OnInit()
    obj = Engine.GetObjectByTag("Light")
    if obj then
        light = obj:GetComponent("LightComponent")
    end

    for i = 1, 5 do
        local num = math.random(10000, 10000000)
        Engine.Log(Engine.Utils.ShortNumberFormat(num, 2), 2)
    end
end

function OnUpdate(dt)
    if not light then return end

    hue = (hue + dt * 0.2) % 1.0

    local rgb = Engine.Utils.HSVtoRGB(hue * 360.0, 1.0, 1.0)
    light:SetColor(rgb)
end
