Unity setting SerializedProperty.prefabOverride incorrectly

Hello, There's a value called SerializedProperty.prefabOverride for every serializable property in unity. A property such as a float inside a script. That property is what makes the value "Dirty". It makes the value look bold on the inspector. When it is bold, if you change the value of the prefab of the instantiated object, the value of that object would not change.

This is good. However, as we edit our levels in the scene, random values would undirty themselves, but their values are clearly different from their prefab coutnerpart. You would imagine, when we changed a value in the prefab, all of the instances of that prefabs's values which were undirty changed as well. A big problem is that it is very hard to reproduce.

I was able to set the variables to dirty forcibly by setting the SerializedProperty.prefabOverride to true and calling ApplyModifiedProperties() on the serializableObject. However, we don't want this as it would set every variable to dirty. Since Unity may not fix this problem for some time as the problem is hard to reproduce, here's the question.

How can we know if a variable is different from its prefab's without using SerializedProperty.prefabOverride?

Since the Update to Unity 3.5 reinitializes all prefabs, this bug prevented us from upgrading to 3.5.

However, I managed to remedy this problem by writing an Editor script that walks over all scenes, breaking and reconnecting all prefabs. All local changes are preserved this way, and all wrongfully “non-bold” entries are fixed in the process.

NOTE: If you already upgraded to Unity 3.5, you are too late. You’ll need a 3.4 copy of your project for this to work.

http://forum.unity3d.com/threads/132489-Resetting-PrefabOverride-Flags-for-Instantiated-Prefabs-in-3.4.x?p=897802&viewfull=1#post897802

I may have found how to fix it. First, you would have to have a custom editor, then get the prefab of the object, then use reflection to compare each value and set the SerializedProperty.prefabOverride.

This is how one would get the prefab from the custom inspector:

var pPrefab : GameObject = EditorUtility.GetPrefabParent(target.gameObject) as GameObject;