using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class ComplexBarSubBar : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler {

    public ComplexBar parentBar;
    public int index;

    public void OnPointerEnter(PointerEventData eventData)
    {
        //Debug.Log("Pointer enter " + this, this);
        if (index < parentBar.labels.Count)
        {
            parentBar.descriptionPanel.gameObject.SetActive(true);
            parentBar.descriptionLabel.text = parentBar.labels [index] + "\n" + parentBar.values [index].ToString();
        }
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        parentBar.descriptionPanel.gameObject.SetActive(false);
    }

}
