mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 08:38:43 +08:00
Updated Event in anticipation of AnimationState changes.
This commit is contained in:
parent
c333b84740
commit
cf01d47796
@ -92,8 +92,8 @@ public class EventTimelineTests {
|
||||
float lastFrame = -1;
|
||||
for (int i = 0; i < eventCount; i++) {
|
||||
float frame = frames[i];
|
||||
Event event = new Event(new EventData("" + events[i]));
|
||||
timeline.setFrame(i, frame, event);
|
||||
Event event = new Event(frame, new EventData("" + events[i]));
|
||||
timeline.setFrame(i, event);
|
||||
maxFrame = Math.max(maxFrame, frame);
|
||||
if (lastFrame != frame) distinctCount++;
|
||||
lastFrame = frame;
|
||||
|
||||
@ -543,8 +543,8 @@ public class Animation {
|
||||
}
|
||||
|
||||
/** Sets the time of the specified keyframe. */
|
||||
public void setFrame (int frameIndex, float time, Event event) {
|
||||
frames[frameIndex] = time;
|
||||
public void setFrame (int frameIndex, Event event) {
|
||||
frames[frameIndex] = event.time;
|
||||
events[frameIndex] = event;
|
||||
}
|
||||
|
||||
|
||||
@ -36,8 +36,10 @@ public class Event {
|
||||
int intValue;
|
||||
float floatValue;
|
||||
String stringValue;
|
||||
final float time;
|
||||
|
||||
public Event (EventData data) {
|
||||
public Event (float time, EventData data) {
|
||||
this.time = time;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
@ -65,6 +67,10 @@ public class Event {
|
||||
this.stringValue = stringValue;
|
||||
}
|
||||
|
||||
public float getTime () {
|
||||
return time;
|
||||
}
|
||||
|
||||
public EventData getData () {
|
||||
return data;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user