fullinspector
fullinspector copied to clipboard
Delegate serialization causing prefab checkout
Hi, First of all, great asset! I have it both at home and now at work and it's a life-saver. :)
We recently found an issue with FullInspector v2.6.3 in Unity 5.5.0f3 where some of our prefabs would constantly get checkout even though they had no modifications. Our version control system is set to lock checked out prefabs so it caused quite a few headaches as people couldn't work because their prefabs were locked by someone that didn't touch it. Here are the repro steps:
- Set the project serialization to FullText. (Not sure if 100% necessary but it helps with the diffs)
- Create a BaseBehavior script with only a public delegate inside.
public class ProblematicScript : FullInspector.BaseBehavior { public delegate void DummyDelegate(); public DummyDelegate ImTheIssueHere; }
- Create a prefab and add the problematic script to it.
- Commit the prefab so you will be able to see it be checked out later. At this point all seems good.
- Cause an assembly reload (adding a space to script somewhere and save).
- Select the prefab in the project view.
- Save the project.
- Notice that the prefab is checked out with no changes in the source control system.
I tracked the behavior down to SaveState<TSerializer> in fiISerializedObjectUtility.cs at if (AreListsDifferent(obj.SerializedStateValues, serializedValues)) {
The lists are indeed different as one has a null and the other has an empty string.
It might be related to the call to RestoreState<TSerializer> when the item is selected at step 6.
Let me know if you need more infos.
I'd like to point out that we also have this issue where prefabs shows as a change in version control but have no content changed. However we don't enforce asset locking so it's not as big of an issue for us. We just reset the changes and move on.