Skip to content

Commit

Permalink
fix exception when building atlas on unity 2022.2 (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
sttz authored Dec 26, 2022
1 parent f6618fc commit e52e074
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Assets/SpriteDicing/Editor/Processors/SpriteBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ private void ApplyPivotChange (Rect rect, Vector2 newPivot)

private Sprite CreateSprite (string name, Texture texture, Vector2 pivot, Rect renderRect)
{
#if UNITY_2022_2_OR_NEWER
// (texture, rect, pivot, pixelsPerUnit, extrude, meshType, border, generateFallbackPhysicsShape, secondaryTexture)
var args = new object[] { texture, renderRect, pivot, ppu, (uint)0, SpriteMeshType.Tight, Vector4.zero, false, null };
#else
// (texture, rect, pivot, pixelsPerUnit, extrude, meshType, border, generateFallbackPhysicsShape)
var args = new object[] { texture, renderRect, pivot, ppu, (uint)0, SpriteMeshType.Tight, Vector4.zero, false };
#endif
var sprite = (Sprite)createSpriteMethod.Invoke(null, args);
sprite.name = name;
sprite.SetVertexCount(vertices.Count);
Expand Down

0 comments on commit e52e074

Please sign in to comment.