Object on illuminated by ligth component

Hello everyone, I’m getting a problem whit scripting.
I dont have any idea how to detect when an object has been illuminated by a specific ligth component.

I search in google but can’t find a working awnser.

I hope than i can find the rigth awnser here.
Have nice day.
PS: Sorry, I dont speak english as well.

depends on the light type.

spot light

* check if angle between light forward direction and light-to-object direction is less then half spot light angle * check if distance to object is less then max distance of light * check if raycast to object hits object and not other geometry that can hide object

point light

* same as above but skip first item with angle

direction light

* just raycast check from (object-position - light-direction * K) to object-position, where K is big enough to be outside from whole scene, to hit any geometry that can cover object