mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 10:16:01 +08:00
Fixed animations with no bone keys.
This commit is contained in:
parent
ff66231378
commit
803a8ab045
@ -114,7 +114,7 @@ namespace Spine {
|
||||
|
||||
// Skins.
|
||||
if (root.ContainsKey("skins")) {
|
||||
Dictionary<String, Object> skinMap = (Dictionary<String, Object>)root["skins"];
|
||||
var skinMap = (Dictionary<String, Object>)root["skins"];
|
||||
foreach (KeyValuePair<String, Object> entry in skinMap) {
|
||||
Skin skin = new Skin(entry.Key);
|
||||
foreach (KeyValuePair<String, Object> slotEntry in (Dictionary<String, Object>)entry.Value) {
|
||||
@ -133,7 +133,7 @@ namespace Spine {
|
||||
|
||||
// Animations.
|
||||
if (root.ContainsKey("animations")) {
|
||||
Dictionary<String, Object> animationMap = (Dictionary<String, Object>)root["animations"];
|
||||
var animationMap = (Dictionary<String, Object>)root["animations"];
|
||||
foreach (KeyValuePair<String, Object> entry in animationMap)
|
||||
ReadAnimation(entry.Key, (Dictionary<String, Object>)entry.Value, skeletonData);
|
||||
}
|
||||
@ -185,6 +185,7 @@ namespace Spine {
|
||||
var timelines = new List<Timeline>();
|
||||
float duration = 0;
|
||||
|
||||
if (map.ContainsKey("bones")) {
|
||||
var bonesMap = (Dictionary<String, Object>)map["bones"];
|
||||
foreach (KeyValuePair<String, Object> entry in bonesMap) {
|
||||
String boneName = entry.Key;
|
||||
@ -192,9 +193,9 @@ namespace Spine {
|
||||
if (boneIndex == -1)
|
||||
throw new Exception("Bone not found: " + boneName);
|
||||
|
||||
Dictionary<String, Object> timelineMap = (Dictionary<String, Object>)entry.Value;
|
||||
var timelineMap = (Dictionary<String, Object>)entry.Value;
|
||||
foreach (KeyValuePair<String, Object> timelineEntry in timelineMap) {
|
||||
List<Object> values = (List<Object>)timelineEntry.Value;
|
||||
var values = (List<Object>)timelineEntry.Value;
|
||||
String timelineName = (String)timelineEntry.Key;
|
||||
if (timelineName.Equals(TIMELINE_ROTATE)) {
|
||||
RotateTimeline timeline = new RotateTimeline(values.Count);
|
||||
@ -237,16 +238,17 @@ namespace Spine {
|
||||
throw new Exception("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (map.ContainsKey("slots")) {
|
||||
Dictionary<String, Object> slotsMap = (Dictionary<String, Object>)map["slots"];
|
||||
var slotsMap = (Dictionary<String, Object>)map["slots"];
|
||||
foreach (KeyValuePair<String, Object> entry in slotsMap) {
|
||||
String slotName = entry.Key;
|
||||
int slotIndex = skeletonData.FindSlotIndex(slotName);
|
||||
Dictionary<String, Object> timelineMap = (Dictionary<String, Object>)entry.Value;
|
||||
var timelineMap = (Dictionary<String, Object>)entry.Value;
|
||||
|
||||
foreach (KeyValuePair<String, Object> timelineEntry in timelineMap) {
|
||||
List<Object> values = (List<Object>)timelineEntry.Value;
|
||||
var values = (List<Object>)timelineEntry.Value;
|
||||
String timelineName = (String)timelineEntry.Key;
|
||||
if (timelineName.Equals(TIMELINE_COLOR)) {
|
||||
ColorTimeline timeline = new ColorTimeline(values.Count);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user