浏览代码

-[JAVASCRIPT] Atlas attachment loader was using the name as the path instead of the path passed to it. It would throw an exception using the path to report the error, making it extremely confusing.

Dario Segura 10 年之前
父节点
当前提交
18584fc496
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      spine-js/spine.js

+ 3 - 3
spine-js/spine.js

@@ -2425,7 +2425,7 @@ spine.AtlasAttachmentLoader = function (atlas) {
 };
 spine.AtlasAttachmentLoader.prototype = {
 	newRegionAttachment: function (skin, name, path) {
-		var region = this.atlas.findRegion(name);
+		var region = this.atlas.findRegion(path);
 		if (!region) throw "Region not found in atlas: " + path + " (region attachment: " + name + ")";
 		var attachment = new spine.RegionAttachment(name);
 		attachment.rendererObject = region;
@@ -2439,7 +2439,7 @@ spine.AtlasAttachmentLoader.prototype = {
 		return attachment;
 	},
 	newMeshAttachment: function (skin, name, path) {
-		var region = this.atlas.findRegion(name);
+		var region = this.atlas.findRegion(path);
 		if (!region) throw "Region not found in atlas: " + path + " (mesh attachment: " + name + ")";
 		var attachment = new spine.MeshAttachment(name);
 		attachment.rendererObject = region;
@@ -2457,7 +2457,7 @@ spine.AtlasAttachmentLoader.prototype = {
 		return attachment;
 	},
 	newSkinnedMeshAttachment: function (skin, name, path) {
-		var region = this.atlas.findRegion(name);
+		var region = this.atlas.findRegion(path);
 		if (!region) throw "Region not found in atlas: " + path + " (skinned mesh attachment: " + name + ")";
 		var attachment = new spine.SkinnedMeshAttachment(name);
 		attachment.rendererObject = region;