Q:

Calculating gameObjects hit by a directional light source

I am trying to figure out in my current game whether a gameObject is lit by a directional light or not. Below is my image inside the Unity game engine

As my game runs around a Day/Night cycle, I need to constantly check which hex tiles are lit and which are not. I am using one directional light source in my scene and I am rotating it around the x-axis for the day night cycle.
Currently, I am using the dot product to calculate if the tile is lit by the directional light but its not very accurate.
 Vector3 forward = Light.transform.TransformDirection(Vector3.forward);
 float dot = Vector3.Dot(forward, -(tile.transform.position - Light.transform.position));

Is there a better way to do check this inside Unity??

A:

If you have the normal vector for the "top" face of the hex and the vector for the directional light it should be easy to determine if that hex is facing the light.
Note that this will check if the hex and the light are facing each other.  This will not detect of another object is in between casting a shadow over the hex.
Vector3 lightDirection = directonLight.transform.forward;

Vector3 hexNormal = hex.transform.up;

//assumes normalized vectors
if (Vector3.Dot(lightDirection, hexNormal ) < 0) {
    //These vectors form an angle >90 and <270 degrees.
    //This means that the light is shining on this face
}
else {
    //these vectors form an angle either <=90 or >=270 degrees. 
    //This means that the light is not shining on this face.
}

If for some reason you are unable to determine the hex's orientation using one of the transform's axes, you could calculate it by comparing the hex's position with the center of the planet.
Vector3 hexNormal = (hex.transform.position - planetCenter.transform.position).normalized;

