瀏覽代碼

[unity] Fix backwards conditional. Some cleanup.

pharan 8 年之前
父節點
當前提交
4dc462e7a8
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      spine-unity/Assets/spine-unity/SkeletonUtility/SkeletonUtility.cs

+ 2 - 4
spine-unity/Assets/spine-unity/SkeletonUtility/SkeletonUtility.cs

@@ -31,7 +31,6 @@
 // Contributed by: Mitch Thompson
 
 using UnityEngine;
-using System.Collections;
 using System.Collections.Generic;
 using Spine;
 
@@ -42,8 +41,7 @@ namespace Spine.Unity {
 	
 		#region BoundingBoxAttachment
 		public static PolygonCollider2D AddBoundingBox (Skeleton skeleton, string skinName, string slotName, string attachmentName, Transform parent, bool isTrigger = true) {
-			skinName = string.IsNullOrEmpty(skinName) ? skinName : skeleton.Data.DefaultSkin.Name;
-			Skin skin = skeleton.Data.FindSkin(skinName);
+			Skin skin = string.IsNullOrEmpty(skinName) ? skeleton.data.defaultSkin : skeleton.data.FindSkin(skinName);
 			if (skin == null) {
 				Debug.LogError("Skin " + skinName + " not found!");
 				return null;
@@ -67,7 +65,7 @@ namespace Spine.Unity {
 
 		public static PolygonCollider2D AddBoundingBoxAsComponent (BoundingBoxAttachment box, Slot slot, GameObject gameObject, bool isTrigger = true) {
 			if (box == null) return null;
-			if (box.IsWeighted()) Debug.LogWarning("UnityEngine.PolygonCollider2D does not support weighted or animated points. Collider will not be animated. Please remove weights and animations from the bounding box in Spine editor.");
+			if (box.IsWeighted()) Debug.LogWarning("UnityEngine.PolygonCollider2D does not support weighted or animated points. Collider will not be animated. If you want to use it as a collider, please remove weights and animations from the bounding box in Spine editor.");
 			var verts = box.GetLocalVertices(slot, null);
 			var collider = gameObject.AddComponent<PolygonCollider2D>();
 			collider.isTrigger = isTrigger;