[/Users/unity-build/Desktop/automatic-build-2/unity/Projects/…/Runtime/Mono/MonoBehaviour.cpp line 721]
After this error something funny may happen: like editing object positions may not work in the sense that the objects may be returned to their positions before this error, however things feel pretty random to me.
Please note, I’m NOT trying to do editor scripting or something like that in my project.
I am getting the same error message and also experience the problem that newly linked prefabs dragged to variables exposed in the inspector frequently are forgetten and they need to be linked a second time. This is happening in Unity v2.0.2
Wow. Plenty of people with this error. How about reproducing the error in a simplified project and sending that via the bug reporter? One from each if possible to determine if the cause is the same.
I am actually getting this error a lot and having positions of objects changed around in the editor without my touching them when this warning comes up…
If the behavior is consistent, please choose Help->Report a Problem, then give us a description of when/where the message is occurring and attach your project folder. We’ll try to reproduce the issue.
I submitted this bug some time ago (#18418), but it was marked as closed. It still happens and is 100% reproducible, though, so I encourage others to submit this too, so hopefully they can get to the bottom of it.
One place I have consistently noticed this bug when I have scripts with OnMouseEnter (and its kin) in the open scene. It seems that Unity will sometimes execute the function while the game is not playing. Since this happens in edit mode, it can affect assets and scene information. One workaround is to add
if (!Application.isPlaying)
return;
to the top of your OnMouseEnter functions. I haven’t tested to see if this is still a problem in 2.1.
Thank you so much, I just started having this problem today and right at the end of a project too. I changed a few buttons so that they would change color when you moused over them. So I was using OnMouseEnter and OnMouseExit.
In the editor if I tried to drag a Material on to them it would call those functions and they would permanently change to that color. It also happened when I was switching back to Unity from Unitron.
Adding your code to those functions fixed my problem though. I hope this problem is addressed in 2.5, I could see it causing huge problems to certain games.