mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[csharp] Minor cleanup: removed unused variable, added null tests to legacy SpriteAttacher class.
This commit is contained in:
parent
a0c0db0f5a
commit
37d569414d
@ -981,7 +981,6 @@ namespace Spine {
|
||||
|
||||
public void Apply (Skeleton skeleton, float lastTime, float time, ExposedList<Event> firedEvents, float alpha, MixBlend blend,
|
||||
MixDirection direction) {
|
||||
string attachmentName;
|
||||
Slot slot = skeleton.slots.Items[slotIndex];
|
||||
if (!slot.bone.active) return;
|
||||
if (direction == MixDirection.Out) {
|
||||
|
||||
@ -60,6 +60,8 @@ namespace Spine.Unity.Examples {
|
||||
|
||||
if (applyPMA) {
|
||||
try {
|
||||
if (sprite == null)
|
||||
return;
|
||||
sprite.texture.GetPixel(0, 0);
|
||||
} catch (UnityException e) {
|
||||
Debug.LogFormat("Texture of {0} ({1}) is not read/write enabled. SpriteAttacher requires this in order to work with a SkeletonRenderer that renders premultiplied alpha. Please check the texture settings.", sprite.name, sprite.texture.name);
|
||||
@ -124,7 +126,10 @@ namespace Spine.Unity.Examples {
|
||||
|
||||
spineSlot = spineSlot ?? skeletonComponent.Skeleton.FindSlot(slot);
|
||||
Shader attachmentShader = applyPMA ? Shader.Find(DefaultPMAShader) : Shader.Find(DefaultStraightAlphaShader);
|
||||
attachment = applyPMA ? sprite.ToRegionAttachmentPMAClone(attachmentShader) : sprite.ToRegionAttachment(SpriteAttacher.GetPageFor(sprite.texture, attachmentShader));
|
||||
if (sprite == null)
|
||||
attachment = null;
|
||||
else
|
||||
attachment = applyPMA ? sprite.ToRegionAttachmentPMAClone(attachmentShader) : sprite.ToRegionAttachment(SpriteAttacher.GetPageFor(sprite.texture, attachmentShader));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user