mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49: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.
|
// Skins.
|
||||||
if (root.ContainsKey("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) {
|
foreach (KeyValuePair<String, Object> entry in skinMap) {
|
||||||
Skin skin = new Skin(entry.Key);
|
Skin skin = new Skin(entry.Key);
|
||||||
foreach (KeyValuePair<String, Object> slotEntry in (Dictionary<String, Object>)entry.Value) {
|
foreach (KeyValuePair<String, Object> slotEntry in (Dictionary<String, Object>)entry.Value) {
|
||||||
@ -133,7 +133,7 @@ namespace Spine {
|
|||||||
|
|
||||||
// Animations.
|
// Animations.
|
||||||
if (root.ContainsKey("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)
|
foreach (KeyValuePair<String, Object> entry in animationMap)
|
||||||
ReadAnimation(entry.Key, (Dictionary<String, Object>)entry.Value, skeletonData);
|
ReadAnimation(entry.Key, (Dictionary<String, Object>)entry.Value, skeletonData);
|
||||||
}
|
}
|
||||||
@ -185,6 +185,7 @@ namespace Spine {
|
|||||||
var timelines = new List<Timeline>();
|
var timelines = new List<Timeline>();
|
||||||
float duration = 0;
|
float duration = 0;
|
||||||
|
|
||||||
|
if (map.ContainsKey("bones")) {
|
||||||
var bonesMap = (Dictionary<String, Object>)map["bones"];
|
var bonesMap = (Dictionary<String, Object>)map["bones"];
|
||||||
foreach (KeyValuePair<String, Object> entry in bonesMap) {
|
foreach (KeyValuePair<String, Object> entry in bonesMap) {
|
||||||
String boneName = entry.Key;
|
String boneName = entry.Key;
|
||||||
@ -192,9 +193,9 @@ namespace Spine {
|
|||||||
if (boneIndex == -1)
|
if (boneIndex == -1)
|
||||||
throw new Exception("Bone not found: " + boneName);
|
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) {
|
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;
|
String timelineName = (String)timelineEntry.Key;
|
||||||
if (timelineName.Equals(TIMELINE_ROTATE)) {
|
if (timelineName.Equals(TIMELINE_ROTATE)) {
|
||||||
RotateTimeline timeline = new RotateTimeline(values.Count);
|
RotateTimeline timeline = new RotateTimeline(values.Count);
|
||||||
@ -237,16 +238,17 @@ namespace Spine {
|
|||||||
throw new Exception("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
|
throw new Exception("Invalid timeline type for a bone: " + timelineName + " (" + boneName + ")");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (map.ContainsKey("slots")) {
|
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) {
|
foreach (KeyValuePair<String, Object> entry in slotsMap) {
|
||||||
String slotName = entry.Key;
|
String slotName = entry.Key;
|
||||||
int slotIndex = skeletonData.FindSlotIndex(slotName);
|
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) {
|
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;
|
String timelineName = (String)timelineEntry.Key;
|
||||||
if (timelineName.Equals(TIMELINE_COLOR)) {
|
if (timelineName.Equals(TIMELINE_COLOR)) {
|
||||||
ColorTimeline timeline = new ColorTimeline(values.Count);
|
ColorTimeline timeline = new ColorTimeline(values.Count);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user