Change texture of an attachment - C# XNA
Hi. I am trying to change the texture of an RegionAttachment, however; I am not really sure how to do it? I have provided you with the code I am stuck on below. The problem is essentially at the comment:
// Modify the texture of the RegionAttachment 'newHeadAttachMent' to Armor.Head.HeadTexture?
Armor.Head.HeadTexture = content.Load<Texture2D>(string.Format(@"Equipment\Armor\{0}", ItemID.ToString("000")));
// Find item attachment
var headItemSlot = skeleton.FindSlot("head");
var crHeadAttachment = headItemSlot.Attachment;
// Create attachment from item image
var newHeadAttachment = (RegionAttachment)crHeadAttachment;
// Modify the texture of the RegionAttachment 'newHeadAttachMent' to Armor.Head.HeadTexture?
// Set item attachment
headItemSlot.Attachment = newHeadAttachment;
Thank you for taking your time to read this post 🙂
Best Regards,