mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-11-04 23:22:57 +08:00
fix: 动画生成器 cycled 结果错误
This commit is contained in:
parent
637647dc17
commit
5382ef3f3d
@ -68,12 +68,13 @@ export class TextureRowAnimater extends FrameBasedAnimater<void> {
|
|||||||
const h = height / this.frames;
|
const h = height / this.frames;
|
||||||
let i = 0;
|
let i = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (i === this.frames) i = 0;
|
|
||||||
const renderable: ITextureRenderable = {
|
const renderable: ITextureRenderable = {
|
||||||
source: this.texture!.source,
|
source: this.texture!.source,
|
||||||
rect: this.texture!.clampRect({ x: i * w + ox, y: oy, w, h })
|
rect: this.texture!.clampRect({ x: i * w + ox, y: oy, w, h })
|
||||||
};
|
};
|
||||||
yield renderable;
|
yield renderable;
|
||||||
|
i++;
|
||||||
|
if (i === this.frames) i = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,12 +106,13 @@ export class TextureColumnAnimater extends FrameBasedAnimater<void> {
|
|||||||
const w = width / this.frames;
|
const w = width / this.frames;
|
||||||
let i = 0;
|
let i = 0;
|
||||||
while (true) {
|
while (true) {
|
||||||
if (i === this.frames) i = 0;
|
|
||||||
const renderable: ITextureRenderable = {
|
const renderable: ITextureRenderable = {
|
||||||
source: this.texture!.source,
|
source: this.texture!.source,
|
||||||
rect: this.texture!.clampRect({ x: i * w + ox, y: oy, w, h })
|
rect: this.texture!.clampRect({ x: i * w + ox, y: oy, w, h })
|
||||||
};
|
};
|
||||||
yield renderable;
|
yield renderable;
|
||||||
|
i++;
|
||||||
|
if (i === this.frames) i = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -202,7 +204,7 @@ export class TextureScanAnimater
|
|||||||
rect: texture.clampRect({ x: x * w, y: y * h, w, h })
|
rect: texture.clampRect({ x: x * w, y: y * h, w, h })
|
||||||
};
|
};
|
||||||
yield data;
|
yield data;
|
||||||
|
index++;
|
||||||
if (index === this.frames) index = 0;
|
if (index === this.frames) index = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user