[unity] Fixes a warning when re-importing a prefab (introduced by commit 4a9f7b8a). Added a null check. See #1273, #1931.

This commit is contained in:
Harald Csaszar 2021-08-06 16:48:51 +02:00
parent 193ba1eacd
commit e321488949

View File

@ -122,8 +122,11 @@ namespace Spine.Unity.Editor {
renderer.Initialize(true, true);
renderer.LateUpdateMesh();
var mesh = meshFilter.sharedMesh;
if (mesh == null) continue;
string meshName = string.Format("Skeleton Prefab Mesh \"{0}\"", renderer.name);
mesh.name = meshName;
mesh.hideFlags = HideFlags.None;
if (context != null)
context.AddObjectToAsset(meshFilter.sharedMesh.name, meshFilter.sharedMesh);
}