- I modify a property via the scripting API.
- The scene is not made dirty.
Scripting APIs do not use the undo mechanism nor mark the scene dirty by default. One can, however, enforce these behaviours.
There are two different options for solving this:
If you have access to the object itself you can use the Undo.RecordObject method before setting the property from the script.
|Undo.RecordObject (myGameObject.transform, "Zero Transform Position");
myGameObject.transform.position = Vector3.zero;
An example showing using how the scene is marked dirty with Undo.RecordObject is attached to this article.
One can also mark the scene as dirty manually using:
after setting a property from script.
LightmapEditorSettings.bakeResolution = 14;