using UnityEngine;

public class P7CharacterInteraction : MonoBehaviour
{
    public Sprite[] emotions; // Assign emotions in Inspector
    public GameObject emojiObject; // Drag the FaceEmoji GameObject from the prefab
    private SpriteRenderer emojiRenderer;

    private int currentEmotion = 0;

    void Start()
    {
        if (emojiObject != null)
        {
            emojiRenderer = emojiObject.GetComponent<SpriteRenderer>();
            emojiObject.SetActive(false); // Start with emoji hidden
        }
        else
        {
            Debug.LogWarning("EmojiObject is not assigned on " + gameObject.name);
        }
    }

    void OnMouseDown()
    {
        if (emojiObject != null && emotions.Length > 0)
        {
            emojiObject.SetActive(true);
            currentEmotion = (currentEmotion + 1) % emotions.Length;
            emojiRenderer.sprite = emotions[currentEmotion];
        }
    }
}
