Kaynağa Gözat

[unity] Shorten BoneFollower.SetBone string API.

pharan 8 yıl önce
ebeveyn
işleme
f62e2e12b8

+ 2 - 2
spine-unity/Assets/spine-unity/BoneFollower.cs

@@ -74,7 +74,7 @@ namespace Spine.Unity {
 
 
 		/// <summary>
 		/// <summary>
 		/// Sets the target bone by its bone name. Returns false if no bone was found.</summary>
 		/// Sets the target bone by its bone name. Returns false if no bone was found.</summary>
-		public bool SetBoneByName (string name) {
+		public bool SetBone (string name) {
 			bone = skeletonRenderer.skeleton.FindBone(name);
 			bone = skeletonRenderer.skeleton.FindBone(name);
 			if (bone == null) {
 			if (bone == null) {
 				Debug.LogError("Bone not found: " + name, this);
 				Debug.LogError("Bone not found: " + name, this);
@@ -130,7 +130,7 @@ namespace Spine.Unity {
 			if (bone == null) {
 			if (bone == null) {
 				if (string.IsNullOrEmpty(boneName)) return;
 				if (string.IsNullOrEmpty(boneName)) return;
 				bone = skeletonRenderer.skeleton.FindBone(boneName);
 				bone = skeletonRenderer.skeleton.FindBone(boneName);
-				if (!SetBoneByName(boneName)) return;
+				if (!SetBone(boneName)) return;
 			}
 			}
 
 
 			Transform thisTransform = this.transform;
 			Transform thisTransform = this.transform;

+ 1 - 1
spine-unity/Assets/spine-unity/Modules/BoundingBoxFollower/Editor/BoundingBoxFollowerInspector.cs

@@ -156,7 +156,7 @@ namespace Spine.Unity.Editor {
 			if (Event.current.type == EventType.Repaint) {
 			if (Event.current.type == EventType.Repaint) {
 				if (addBoneFollower) {
 				if (addBoneFollower) {
 					var boneFollower = follower.gameObject.AddComponent<BoneFollower>();
 					var boneFollower = follower.gameObject.AddComponent<BoneFollower>();
-					boneFollower.SetBoneByName(follower.Slot.Data.BoneData.Name);
+					boneFollower.SetBone(follower.Slot.Data.BoneData.Name);
 					addBoneFollower = false;
 					addBoneFollower = false;
 				}
 				}