Hi there,
Half way through an animation I want to change skins (dynamically chosen), so I created an event called "Change Skin". When I receive this event I run the below method with the equipment I want:
void UpdateSkin(params EquipmentDataBase[] equipmentData) {
_loadoutSkin = _loadoutSkin ?? new Skin("Loadout");
_loadoutSkin.Clear();
foreach (EquipmentDataBase equipment in equipmentData) {
if (equipment == null) { continue; }
_loadoutSkin.Append(_spineSkeleton.Data.FindSkin(equipment.AnimationName));
}
_spineSkeleton.SetSkin(_loadoutSkin);
_spineSkeleton.SetSlotsToSetupPose();
_spineAnimationState.Apply(_spineSkeleton);
}
However when I do this, Unity completely freezes. The UpdateSkin method works fine outside of the event. I assume it's a StackOverflow that I never receive, but I was wondering if I'm missing something? Is there any problem with swapping a skin using an Event?
Thanks!