mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 07:14:55 +08:00
Added pingpongReverse to SequenceTimeline.
This commit is contained in:
parent
473862c67e
commit
a898aed293
@ -2494,16 +2494,22 @@ public class Animation {
|
||||
case loop:
|
||||
index %= count;
|
||||
break;
|
||||
case pingpong:
|
||||
case pingpong: {
|
||||
int n = (count << 1) - 2;
|
||||
index %= n;
|
||||
if (index >= count) index = n - index;
|
||||
break;
|
||||
}
|
||||
case onceReverse:
|
||||
index = Math.max(count - 1 - index, 0);
|
||||
break;
|
||||
case loopReverse:
|
||||
index = count - 1 - (index % count);
|
||||
break;
|
||||
case pingpongReverse:
|
||||
int n = (count << 1) - 2;
|
||||
index = (index + count - 1) % n;
|
||||
if (index >= count) index = n - index;
|
||||
}
|
||||
}
|
||||
slot.setSequenceIndex(index);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user