diff --git a/cocos/spine/assembler/simple.ts b/cocos/spine/assembler/simple.ts index c99dc74fcc6..45fb119ad8e 100644 --- a/cocos/spine/assembler/simple.ts +++ b/cocos/spine/assembler/simple.ts @@ -175,7 +175,7 @@ function realTimeTraverse (comp: Skeleton): void { let indexOffset = 0; let indexCount = 0; for (let i = 0; i < count; i += 6) { - indexCount = data.get(i+3); + indexCount = data.get(i + 3); const material = _getSlotMaterial(data.get(i + 4), comp); const textureID: number = data.get(i + 5); comp.requestDrawData(material, textureID, indexOffset, indexCount); diff --git a/cocos/spine/lib/spine-core.d.ts b/cocos/spine/lib/spine-core.d.ts index b4f1a654220..81ad182f431 100644 --- a/cocos/spine/lib/spine-core.d.ts +++ b/cocos/spine/lib/spine-core.d.ts @@ -700,7 +700,7 @@ declare namespace spine { scale: number; private linkedMeshes; constructor(attachmentLoader: AttachmentLoader); - readSkeletonData(json: string | any): SkeletonData; + readSkeletonData(json: any): SkeletonData; readAttachment(map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment; readVertices(map: any, attachment: VertexAttachment, verticesLength: number): void; readAnimation(map: any, name: string, skeletonData: SkeletonData): void; diff --git a/cocos/spine/skeleton.ts b/cocos/spine/skeleton.ts index edb250a0f10..c188de758f7 100644 --- a/cocos/spine/skeleton.ts +++ b/cocos/spine/skeleton.ts @@ -305,7 +305,7 @@ export class Skeleton extends UIRenderer { _vBuffer: Uint8Array | null = null; _iLength = 0; _iBuffer: Uint8Array | null = null; - _model: any | undefined; + _model: any; _tempColor: Color = new Color(1, 1, 1, 1); constructor () { @@ -1015,7 +1015,7 @@ export class Skeleton extends UIRenderer { } this._updateCache(dt); } else { - if(EDITOR_NOT_IN_PREVIEW) this._instance.updateAnimation(dt); + if (EDITOR_NOT_IN_PREVIEW) this._instance.updateAnimation(dt); } } @@ -1610,11 +1610,9 @@ export class Skeleton extends UIRenderer { const g = this._color.g / 255.0; const b = this._color.b / 255.0; const a = this.node._uiProps.opacity; - - if (this._tempColor.r === r || - this._tempColor.g === g || - this._tempColor.b === b) - { return; } + if (this._tempColor.r === r && this._tempColor.g === g && this._tempColor.b === b) { + return; + } this._tempColor.set(r, g, b, this._tempColor.a); this._instance.setColor(r, g, b, a); }