Search Issue Tracker
Planned for 2019.4, 2020.2
Prefabs are reimporting every time a code change is made
Based on the discussion on this forum thread: https://forum.unity.com/threads/prefabs-are-reimporting-every-time-a-code-change-is-made.939756
I was discovered that when the following conditions aligned, all Prefabs with a [SerializeField] attribute in a Script were reimporting:
1. Create a project
2. Create a Prefab (PrefabA)
3. Create a new Monobehaviour (i.e. ScriptA.cs)
4. Create another Monobehaviour (i.e. ScriptB.cs)
5. Add ScriptA & ScriptB to a prefab.
6. In Script A, add a private variable:
[SerializeField] private ScriptB scriptReference;
7. Add a new Script that contains this (AssemblyStaticInfo.cs):
8. Create a new script (UnrelatedScript.cs)
9. Modify that script, and notice that EVERYTIME UnrelatedScript is modified, PrefabA is reimported.
10. Remove the [SerializeField] from ScriptA
11. Notice the Prefab no longer reimports.
Expected: Unrelated code changes should not reimport prefabs.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- NullReferenceException when selecting a Dropdown Component override in the Prefab Overrides menu for the second time
- USS variables are broken on IOS
- Crash when project is reopened or upgraded
- Hub doesn't install windows 10 sdk properly
- Crash building for iOS after canceling a build