Skin issues with Spine

I am using Spine for my 2D art. I have a problem though. I need to toggle between 2 skins for one of my enemy sprites like so:

77380-skin-issue-0.png

I wrote the code that toggles said skin,

public class EnemyBehavior : MonoBehaviour {
    
    public GameObject enemy;
    
    //Reactions between rock enemy and player
    void OnCollisionEnter2D(Collision2D other)
    {
        Debug.Log("enters");
        if (other.gameObject.tag == Constants.Player)
        {
            enemy.GetComponent<SkeletonAnimator>().initialSkinName = "Alert";            
        }
    }

    void OnCollisionExit2D(Collision2D other)
    {
        if (other.gameObject.tag == Constants.Player)
        {
            enemy.GetComponent<SkeletonAnimator>().initialSkinName = "NoAlert";
        }
    }
}

It even shows in the inspector that the character’s Initial Skin name changes but not the skin itself therefore the character is stuck on the first skin I assign it.

What I found out is that when I click on the Reload button at the upper right of the Skeleton Animator script the skin changes!

My question then becomes: is it possible to call the Reload button through code? And if so, how do I access it? Many thanks in advance!

So I found the solution! My problem was that I was setting the name text rather than call the actual skin name. For that all I had to do was to call this function in script:

enemy.GetComponent<SkeletonAnimator>().skeleton.SetSkin(Constant.SkinName);

Source