Skip to content

Commit

Permalink
Merge pull request #11 from decentraland/update/tween
Browse files Browse the repository at this point in the history
Update Tween duration to use seconds insted of ms
  • Loading branch information
nicoecheza authored Feb 15, 2024
2 parents a16d234 + 8043b92 commit bb7f8ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tween.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function createTweens(targetEngine: IEngine) {
const tween = Tween.get(entity)
tweenData.normalizedTime += dt

if (tweenData.normalizedTime >= (tween.duration / 1000)) {
if (tweenData.normalizedTime >= tween.duration) {
deadTweens.push(entity)
}
}
Expand Down Expand Up @@ -59,7 +59,7 @@ function createTweens(targetEngine: IEngine) {
const currentTime = duration === 0 ? 1 : 0
tweenMap.set(entity, { normalizedTime: currentTime, callback: onFinish })
Tween.createOrReplace(entity, {
duration,
duration: duration * 1000,
easingFunction: getEasingFunctionFromInterpolation(interpolationType),
currentTime,
mode: Tween.Mode[mode]({ start: start as any, end: end as any })
Expand Down

0 comments on commit bb7f8ca

Please sign in to comment.