Detect light or shadow falling on player

Hello guys. I have a question about light.
I have a idea as temperature.
it means that if player is detecting by light, or if player isn’t in shadow for 10/15 minutes, the player temperature increases hmm e.g. 0.5 degree C.
Can I detect a light(sun light) falling on player in real time?
Maybe You have a other ideas about this?
Thanks for help.
(sorry for my bad english, i’m a Polish) :>

You can send Raycasts between your player and the lights which are close enough to potentially lit the player. If your Raycasts are set to hit only your platforms (or any element blocking lights) then for each raycast if the result is null you will know that the player is currently being lit by the light.