using UnityEngine;

public class Chin : MonoBehaviour
{
    public SpriteRenderer goatee;
    public SpriteRenderer chin;

    public Sprite[] goateeSprites;
    
    public void setGoatee(Color facialHairColor, bool enabled)
    {
        this.goatee.enabled = enabled;
        this.goatee.sprite = this.sort(this.goateeSprites);
        this.goatee.color = facialHairColor;
    }

    private Sprite sort(Sprite[] spriteList)
    {
        Sprite result = null;

        if (spriteList != null && spriteList.Length > 0)
        {
            result = spriteList[Random.Range(0, spriteList.Length)];
        }

        return result;
    }
}