mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[unity] Shorten BoneFollower.SetBone string API.
This commit is contained in:
parent
02d1bfc465
commit
f62e2e12b8
@ -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;
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user