Attachment attachment = skeletonAnimation.skeleton.GetAttachment(slotName, attachmentName);
otherSkeletonAnimation.skeleton.GetSlot(slotName).Attachment = attachment;
Thanks for help. I will try to do by this way.
Nate schrieb
I have tried to do, but no results. Do you have example for that?
Here is my code:
public SkeletonAnimation daggerSkeletonAnimation;
private SkeletonAnimation skeletonAnimation;
// Use this for initialization
void Start () {
characterSkeletonAnimation = GetComponent<SkeletonAnimation>();
if (daggerSkeletonAnimation.skeleton == null)
{
Debug.LogError("dagger skeleton is null");
}
Attachment rightHandWeapon = daggerSkeletonAnimation.skeleton.GetAttachment("right hand item", "dagger");
if (rightHandWeapon != null)
{
// Assigned attachment for weapon slot but not effect.
characterSkeletonAnimation.skeleton.FindSlot("weapon").Attachment = rightHandWeapon;
}
}
daggerSkeletonAnimation is weapon animation that referenced from the outside. After implement this code weapon not be assigned for character? Look forward the help. Thanks!