--авто
CustomLights[422] = {
    init = function (anim)
        anim.turnLightsInterval = 0.35
    end,

    stateHandlers = {
        ["turn_left"] = function (anim, state)
            if state then
                anim.setLightColor("shader_turn_left_1", 1, 0.6, 0)
            end
            anim.setLightState("shader_turn_left_1", state)
        end,
        ["turn_right"] = function (anim, state)
            if state then
                anim.setLightColor("shader_turn_right_1", 1, 0.6, 0)
            end
            anim.setLightState("shader_turn_right_1", state)
        end,
        ["front"] = function (anim, state)
            -- Если включен поворотник, состояние не обновляется
            if not anim.getLightState("turn_left") then
                if state then
                    anim.setLightColor("shader_turn_left_1", 255, 255, 255)
                end
                anim.setLightState("shader_turn_left_1", state)
            end
            if not anim.getLightState("turn_right") then
                if state then
                    anim.setLightColor("shader_turn_right_1", 255, 255, 255)
                end
                anim.setLightState("shader_turn_right_1", state)
            end
        end,
    },

    dataHandlers = {
        ["turn_left"] = function (anim, state)
            if not state and anim.getLightState("front") then
                anim.setLightColor("shader_turn_left_1", 255, 255, 255)
                anim.setLightState("shader_turn_left_1", true)
            end
        end,
        ["turn_right"] = function (anim, state)
            if not state and anim.getLightState("front") then
                anim.setLightColor("shader_turn_right_1", 255, 255, 255)
                anim.setLightState("shader_turn_right_1", true)
            end
        end,
        ["emergency_light"] = function (anim, state)
            if not state and anim.getLightState("front") then
                anim.setLightColor("shader_turn_left_1", 255, 255, 255)
                anim.setLightState("shader_turn_left_1", true)
                anim.setLightColor("shader_turn_right_1", 255, 255, 255)
                anim.setLightState("shader_turn_right_1", true)
            end
        end
    },

    lights = {
        {name = "shader_turn_left_1",  material = "shader_turn_left_1" , colorMul = 1.6 },
        {name = "shader_turn_right_1", material = "shader_turn_right_1", colorMul = 1.6 },
    }
}