mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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;
|
float lastFrame = -1;
|
||||||
for (int i = 0; i < eventCount; i++) {
|
for (int i = 0; i < eventCount; i++) {
|
||||||
float frame = frames[i];
|
float frame = frames[i];
|
||||||
Event event = new Event(new EventData("" + events[i]));
|
Event event = new Event(frame, new EventData("" + events[i]));
|
||||||
timeline.setFrame(i, frame, event);
|
timeline.setFrame(i, event);
|
||||||
maxFrame = Math.max(maxFrame, frame);
|
maxFrame = Math.max(maxFrame, frame);
|
||||||
if (lastFrame != frame) distinctCount++;
|
if (lastFrame != frame) distinctCount++;
|
||||||
lastFrame = frame;
|
lastFrame = frame;
|
||||||
|
|||||||
@ -543,8 +543,8 @@ public class Animation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the time of the specified keyframe. */
|
/** Sets the time of the specified keyframe. */
|
||||||
public void setFrame (int frameIndex, float time, Event event) {
|
public void setFrame (int frameIndex, Event event) {
|
||||||
frames[frameIndex] = time;
|
frames[frameIndex] = event.time;
|
||||||
events[frameIndex] = event;
|
events[frameIndex] = event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,8 +36,10 @@ public class Event {
|
|||||||
int intValue;
|
int intValue;
|
||||||
float floatValue;
|
float floatValue;
|
||||||
String stringValue;
|
String stringValue;
|
||||||
|
final float time;
|
||||||
|
|
||||||
public Event (EventData data) {
|
public Event (float time, EventData data) {
|
||||||
|
this.time = time;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -65,6 +67,10 @@ public class Event {
|
|||||||
this.stringValue = stringValue;
|
this.stringValue = stringValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public float getTime () {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
public EventData getData () {
|
public EventData getData () {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user