Distant lights have two properties which affect shadows in lightmaps: Shadow Angle and
Shadow Samples. How could I adjust these properties of from script?
This is one way to do it:
SerializedObject serialObj = new SerializedObject(lightGameObject.light);
SerializedProperty shadowSampleProp = serialObj.FindProperty("m_ShadowSamples");
shadowSampleProp.intValue = 10;
SerializedProperty shadowAngleProp = serialObj.FindProperty("m_ShadowAngle");
shadowAngleProp.floatValue = 10;
serialObj.ApplyModifiedProperties();