Parcourir la source

[ts][pixi-v8] Fix: pixi v8 bug in validate renderables (#2717)

* Update SpinePipe.ts

* fix a little spine issue
Mat Groves il y a 8 mois
Parent
commit
50e3b405b5

+ 2 - 1
spine-ts/spine-pixi-v8/src/Spine.ts

@@ -377,6 +377,7 @@ export class Spine extends ViewContainer {
 	}
 
 	private validateAttachments () {
+
 		const currentDrawOrder = this.skeleton.drawOrder;
 
 		const lastAttachments = this._lastAttachments;
@@ -404,7 +405,7 @@ export class Spine extends ViewContainer {
 			lastAttachments.length = index;
 		}
 
-		this.spineAttachmentsDirty = spineAttachmentsDirty;
+		this.spineAttachmentsDirty ||= spineAttachmentsDirty;
 	}
 
 	private updateAndSetPixiMask (slot: Slot, last: boolean) {

+ 6 - 0
spine-ts/spine-pixi-v8/src/SpinePipe.ts

@@ -117,6 +117,9 @@ export class SpinePipe implements RenderPipe<Spine> {
 
 		spine._validateAndTransformAttachments();
 
+		spine.spineAttachmentsDirty = false;
+		spine.spineTexturesDirty = false;
+
 		for (let i = 0, n = drawOrder.length; i < n; i++) {
 			const slot = drawOrder[i];
 			const attachment = slot.getAttachment();
@@ -154,6 +157,9 @@ export class SpinePipe implements RenderPipe<Spine> {
 		const gpuSpine = this.gpuSpineData[spine.uid];
 
 		spine._validateAndTransformAttachments();
+		
+		spine.spineAttachmentsDirty = false;
+		spine.spineTexturesDirty = false;
 
 		const drawOrder = spine.skeleton.drawOrder;