From b9b565e64a0267030cb8aa9f970740254993d0cc Mon Sep 17 00:00:00 2001 From: VisualSj Date: Tue, 4 Aug 2015 16:04:35 +0800 Subject: [PATCH] Update JSON parser --- .../js-bindings/script/studio/parsers/action-2.x.js | 2 +- .../script/studio/parsers/timelineParser-2.x.js | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js b/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js index b4f4a89b32..dcf168a218 100644 --- a/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js +++ b/cocos/scripting/js-bindings/script/studio/parsers/action-2.x.js @@ -113,7 +113,7 @@ name: "Rotation", handle: function(options){ var frame = new ccs.RotationFrame(); - var rotation = options["Rotation"]; + var rotation = options["Rotation"] || options["Value"] || 0; frame.setRotation(rotation); return frame; } diff --git a/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js b/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js index 23ea0bc725..b3c3dc6022 100644 --- a/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js +++ b/cocos/scripting/js-bindings/script/studio/parsers/timelineParser-2.x.js @@ -104,7 +104,9 @@ var visible = getParam(json["VisibleForFrame"], true); node.setVisible(visible); - setContentSize(node, json["Size"]); + var size = json["Size"]; + if(size) + setContentSize(node, size); if (json["Alpha"] != null) node.setOpacity(json["Alpha"]); @@ -118,9 +120,7 @@ extensionData.setCustomProperty(customProperty); extensionData.setActionTag(actionTag); if (node.getComponent("ComExtensionData")) - { node.removeComponent("ComExtensionData"); - } node.addComponent(extensionData); node.setCascadeColorEnabled(true); @@ -294,9 +294,7 @@ extensionData.setCustomProperty(customProperty); extensionData.setActionTag(actionTag); if (widget.getComponent("ComExtensionData")) - { widget.removeComponent("ComExtensionData"); - } widget.addComponent(extensionData); var rotationSkewX = json["RotationSkewX"];