[unity] Shorten BoneFollower.SetBone string API.

This commit is contained in:
pharan 2017-06-26 14:14:04 +08:00
parent 02d1bfc465
commit f62e2e12b8
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;
} }