- Home /
Question by
Jaywalker · Mar 29, 2011 at 08:47 PM ·
javascriptarrayeditor-scriptingscalebeast
scale in lightmap access possible with Javascript?
Hey!
For an editor script I'm trying to access the scale in lightmap from Javascript.
the solution i found on Unityanswers is written in c# (i'm guessing)
is-there-a-way-to-set-an-objects-scale-in-lightmap-in-a-script
:
can anyone tell me if it is at all possible in Javascript and maybe point me in the right direction, to where I can best start to learn how to do this?
Thanks a lot!
Comment
Best Answer
Answer by Jaywalker · Mar 30, 2011 at 09:16 AM
Ok it took a while but I figured it out, this will change the scale in lightmap value for the selected object to 0.9;
var so : SerializedObject = new SerializedObject(Selection.activeGameObject.GetComponent(Renderer));
so.FindProperty("m_ScaleInLightmap").floatValue = 0.9;
so.ApplyModifiedProperties();
I hope it helps someone else!
cheers!