Skip to content

Commit e333b1e

Browse files
authored
Merge pull request #388 from Unity-Technologies/bugfix/1324399-fix-build-with-prefabs
Fixing errors popping in console when building scenes with prefabs
2 parents 86753da + af30b37 commit e333b1e

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
88

99
### Bug Fixes
1010

11+
- [case: 1324399] Fixing errors when building with prefabs in scene.
1112
- [case: 1323666] Preventing to assign an empty mesh as MeshCollider.
1213
- [case: 1322032] Fixing wrong ProBuilderMesh colors on domain reload when null.
1314
- [case: 1322150] Fixing torus and sphere UV generation when creating New Shape.

Editor/EditorCore/UnityScenePostProcessor.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static void OnPostprocessScene()
2727
// Hide nodraw faces if present.
2828
foreach (var pb in pbMeshes)
2929
{
30-
if (pb.GetComponent<MeshRenderer>() == null)
30+
if (pb.GetComponent<MeshRenderer>() == null || UnityEditor.EditorUtility.IsPersistent(pb))
3131
continue;
3232

3333
if (pb.GetComponent<MeshRenderer>().sharedMaterials.Any(x => x != null && x.name.Contains("NoDraw")))
@@ -55,6 +55,9 @@ public static void OnPostprocessScene()
5555

5656
foreach (var mesh in pbMeshes)
5757
{
58+
if (UnityEditor.EditorUtility.IsPersistent(mesh))
59+
continue;
60+
5861
EditorUtility.SynchronizeWithMeshFilter(mesh);
5962

6063
if (mesh.mesh == null)
@@ -82,6 +85,7 @@ public static void OnPostprocessScene()
8285
continue;
8386

8487
StripProBuilderScripts.DestroyProBuilderMeshAndDependencies(gameObject, mesh, true);
88+
8589
}
8690
}
8791

0 commit comments

Comments
 (0)