While using @script ExecuteInEditMode
to view my meshes and textures in edit mode, I am noticing that the scene wants to be saved even if no changes have been made. For example if I open the project, then change between scenes then there is no save prompt. But if I hit play then stop, the scene prompts to be saved. Why is this, and how could it affect my scene if I choose to save or not to save (that is the question!)
@script ExecuteInEditMode
(in function)
// Assign material UVs to mesh UVs
var theMesh : Mesh;
if (!EditorApplication.isPlaying) {
theMesh = theObject.GetComponent(MeshFilter).sharedMesh as Mesh;
}
else {
theMesh = theObject.GetComponent(MeshFilter).mesh as Mesh;
}
here is a package with 2 scenes included to show the issue, swapping between scenes is fine, hit play then stop and change scenes and there is a ‘Save Scene’ prompt : http://www.alucardj.net16.net/unityquestions/Editor_Issue.unitypackage
Edit : My editor problems are not only with this question. If anyone has information that could shed light on this, it would be greatly appreciated. I have similar problems with a mesh creator I wrote with it’s own editor script (can instantiate mesh in edit mode, while playing the verts are animated, but after stopping and restarting the verts don’t animate, whether I just re-assign the verts or reconstruct the mesh inc recalculateBounds/Normals, other cases where textures don’t update after play-stop-play). Creating these editor classes would be great and really handy for stage layouts instead of constantly hitting play and making minor adjustments.
this comes from my answer that can be found here : atlas tool like ngui - Questions & Answers - Unity Discussions