Ammount of Light received by a GameObject

Hi guys,

I would like to make a kind of solar panel but after searching for an hour, I have no idea how to do that.

Basically, the panel would calculate the amount of energy produced using the amount of light received on it but I don’t know how to get that.

Does anyone have an idea ?

Thanks a lot !

I would cheat, and set up an array of positions(containing whether there is a shadow there) or have some sort of collider attached to a “shadow” object that can come in contact with the panel, also have variables such as

 bool isDay = true;
 bool isFoggy = false;

 float fogPenalty = 0.2f;
 float lightBonus = 1.0f;
 float lightPenalty = 0.1f;

 float energyProduced = 0;

 void someKindOfTimerFunction()
 energyProduced += lightBonus;
 else if(!isDay)
 energyProduced += lightPenalty;
 energyProduced -= fogPenalty;