From d2d82fe85897e463393f03a3eba4d14fa009c8be Mon Sep 17 00:00:00 2001 From: lirongf <619213582@qq.com> Date: Mon, 30 Sep 2024 19:02:54 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=EF=BC=9A=20alpha=20get=20from=20contex?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layaAir/laya/spine/Spine2DRenderNode.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/layaAir/laya/spine/Spine2DRenderNode.ts b/src/layaAir/laya/spine/Spine2DRenderNode.ts index 98582403f..922b7a239 100644 --- a/src/layaAir/laya/spine/Spine2DRenderNode.ts +++ b/src/layaAir/laya/spine/Spine2DRenderNode.ts @@ -179,13 +179,13 @@ export class Spine2DRenderNode extends BaseRenderNode2D implements ISpineSkeleto this._spriteShaderData.setBuffer(SpineShaderInit.NMatrix, buffer); Vector2.TempVector2.setValue(context.width, context.height); this._spriteShaderData.setVector2(SpineShaderInit.Size, Vector2.TempVector2); - - if (this._oldAlpha !== (this.owner as Sprite).alpha) { + context.globalAlpha + if (this._oldAlpha !== context.globalAlpha) { let scolor = this.spineItem.getSpineColor(); - let a = scolor.a * (this.owner as Sprite).alpha; + let a = scolor.a * context.globalAlpha; let color = new Color(scolor.r , scolor.g , scolor.b , a); this._spriteShaderData.setColor(SpineShaderInit.Color, color); - this._oldAlpha = (this.owner as Sprite).alpha; + this._oldAlpha = context.globalAlpha; } context._copyClipInfoToShaderData(this._spriteShaderData); }