public override Vector3 GetPosition(string name) { for (int i = 0; overridePoint != null && i < overridePoint.Length; i++) { if (overridePoint[i].gameObject.name == name) { return(overridePoint[i].position); } } if (skeletonAnimation != null && skeletonAnimation.skeleton != null) { // TODO: check range Spine.Bone bone = skeletonAnimation.skeleton.FindBone(name); if (bone != null) { Vector3 pos = new Vector3(bone.WorldX, bone.WorldY, 0); return(spineObject.transform.TransformPoint(pos)); } } Vector3 spos; if (GetSpecialPosition(name, out spos)) { return(spos); } return(gameObject.transform.TransformPoint(new Vector3(0, 1, 0))); }
public Slot(SlotData data, Spine.Bone bone) { if (data == null) { throw new ArgumentNullException("data", "data cannot be null."); } if (bone == null) { throw new ArgumentNullException("bone", "bone cannot be null."); } this.data = data; this.bone = bone; this.SetToSetupPose(); }