mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 11:43:19 +08:00
Never reset drift time
This commit is contained in:
committed by
Lukas Klingsbo
parent
b3615f1cac
commit
697a592c21
@ -55,7 +55,7 @@ abstract class ComponentEffect<T extends Component> {
|
|||||||
}
|
}
|
||||||
if (isInfinite) {
|
if (isInfinite) {
|
||||||
if ((!isAlternating && isMax()) || (isAlternating && isMin())) {
|
if ((!isAlternating && isMax()) || (isAlternating && isMin())) {
|
||||||
reset(resetDriftTime = false);
|
reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!hasFinished()) {
|
if (!hasFinished()) {
|
||||||
@ -86,12 +86,11 @@ abstract class ComponentEffect<T extends Component> {
|
|||||||
bool isMax() => percentage == null ? false : percentage == 1.0;
|
bool isMax() => percentage == null ? false : percentage == 1.0;
|
||||||
bool isMin() => percentage == null ? false : percentage == 0.0;
|
bool isMin() => percentage == null ? false : percentage == 0.0;
|
||||||
|
|
||||||
void reset({bool resetDriftTime = true}) {
|
void reset() {
|
||||||
_isDisposed = false;
|
_isDisposed = false;
|
||||||
percentage = null;
|
percentage = null;
|
||||||
currentTime = 0.0;
|
currentTime = 0.0;
|
||||||
curveDirection = 1;
|
curveDirection = 1;
|
||||||
driftTime = resetDriftTime ? 0.0 : driftTime;
|
|
||||||
isInfinite = _initialIsInfinite;
|
isInfinite = _initialIsInfinite;
|
||||||
isAlternating = _initialIsAlternating;
|
isAlternating = _initialIsAlternating;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user