Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Commit

Permalink
fix: sprite sheet ani bug (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
cptbtptpbcptdtptp authored Jul 18, 2023
1 parent 6c88ec8 commit 8c86446
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions playground/sprite-sheetAnimation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ class FrameSpriteScript extends Script {
/** Total frames. */
private _totalFrames: number;
/** Frame interval time, the unit of time is ms. */
private _frameInterval: number = 150;
private _frameInterval: number = 0.15;

private _sprite: Sprite;
private _curFrameIndex: number;
private _cumulativeTime: number = 0;
private _birdTransform: Transform;

onAwake(): void {
// Sprite sheet animation pictures have 4 rows and 4 columns, if you modify the picture, please modify this.
// Sprite sheet animation pictures have 3 rows and 1 columns, if you modify the picture, please modify this.
const row = 3;
const col = 1;
const reciprocalSliceWidth = 1 / row;
Expand Down

0 comments on commit 8c86446

Please sign in to comment.