Reimporting a script causes Unity to create new “Hidden/Preview Transparent” materials every time.
Reproduce
-
Open attached project or create new one
-
Open Profiler, select Memory tab
-
Switch to “Detailed” mode
-
Press “Take sample Editor”
-
Expand “Scene Memory” and note the Material count
-
Reimport “Scripts/NewBehaviourScript.cs”
-
Press “Take sample Editor”
-
Goto step 4
Actual
Every script reimport new materials are being created, more precisely new copies of the “Hidden/Preview Transparent” material.
Expected
No material leak.