File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ mixin GSYFlarePullController implements FlareController {
77
88 double pulledExtentFlare = 0 ;
99 double _refreshTriggerPullDistance = 140 ;
10+ double _speed = 2.0 ;
11+ double _rockTime = 0.0 ;
1012
1113 @override
1214 void initialize (FlutterActorArtboard artboard) {
@@ -18,16 +20,17 @@ mixin GSYFlarePullController implements FlareController {
1820
1921 @override
2022 bool advance (FlutterActorArtboard artboard, double elapsed) {
21- if (getPlayAuto) {
22- return false ;
23+ if (getPlayAuto) {
24+ _rockTime += elapsed * _speed;
25+ _pullAnimation.apply (_rockTime % _pullAnimation.duration, artboard, 1.0 );
26+ return true ;
2327 }
2428 double animationPosition = pulledExtentFlare / _refreshTriggerPullDistance;
2529 animationPosition *= animationPosition;
26- _pullAnimation.apply (
27- _pullAnimation.duration * animationPosition , artboard, 1.0 );
30+ _rockTime = _pullAnimation.duration * animationPosition;
31+ _pullAnimation.apply (_rockTime , artboard, 1.0 );
2832 return true ;
2933 }
3034
3135 bool get getPlayAuto;
32-
3336}
You can’t perform that action at this time.
0 commit comments