[Unity5]How to set lightmap parameter for mesh renderer by script?

In Unity 5, the lightmap system come up with a new features that it can specify ligthmap parameters, in my project, we need to set lightmap parameter for each mesh renderer by script , but i can’t find how to get it done…it seems unity doesn’t open this interface.

Window → Ligthing → Renderers → Advanced Lightmap Parameters, currently we have to manually set it to each renderer…

Any guys know how to get it done by script ??

Interesting, I created a brand new thread about this here, so just for full clarity’s sake, you may remove my thread, but even after trying to access serialized properties, I didn’t have any luck.

http://forum.unity3d.com/threads/assign-lightmap-parameters-to-individual-objects-via-c.384359/

@ArteyS’s link does suggest a solution that works fine:

UnityEditor.SerializedObject Sob = new UnityEditor.SerializedObject(r);
UnityEditor.SerializedProperty Sprop = Sob.FindProperty("m_LightmapParameters");
Sprop.objectReferenceValue = yourLightmapParameters;
Sob.ApplyModifiedProperties();

The property’s name is m_LightmapParameters which you can modify as you do any others.