Commits

David Erosa committed 4dff870

Destroy container before generating colliders

  • Participants
  • Parent commits 482061b

Comments (0)

Files changed (1)

File Editor/TileMapEditor.cs

 			MeshCollider collider = TMap.GetComponent<MeshCollider>();
 			if (collider)
 				DestroyImmediate(collider, true);
+			if(TMap.transform.FindChild("Colliders") != null){
+				DestroyImmediate(TMap.transform.FindChild("Colliders").gameObject, true);
+			}
 			collider = TMap.gameObject.AddComponent<MeshCollider>();
 			collider.sharedMesh = TMap.CreateColliderMesh();		
 		}