Skip to content

Commit

Permalink
feat: add support for SpriteAtlas
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Apr 30, 2020
1 parent b7253e8 commit b31e325
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Packages/UIParticle/Scripts/UIParticle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Profiling;
using UnityEngine.Rendering;
using UnityEngine.UI;
using ShaderPropertyType = Coffee.UIExtensions.UIParticle.AnimatableProperty.ShaderPropertyType;

Expand Down Expand Up @@ -88,7 +89,9 @@ public override Texture mainTexture
var textureSheet = cachedParticleSystem.textureSheetAnimation;
if (textureSheet.enabled && textureSheet.mode == ParticleSystemAnimationMode.Sprites && 0 < textureSheet.spriteCount)
{
tex = textureSheet.GetSprite(0).texture;
var sprite = textureSheet.GetSprite(0);
textureSheet.uvChannelMask = (UVChannelFlags) (sprite.packed ? -1 : 0);
tex = sprite.texture;
}
Profiler.EndSample();
}
Expand Down Expand Up @@ -603,4 +606,4 @@ void UpdateAnimatableMaterialProperties()
}
}
}
}
}

0 comments on commit b31e325

Please sign in to comment.