Hi i was trying to use event system, its great but i doing something that i need to set it on a canvas, not in the component itself
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Collections;
public class IComponents : MonoBehaviour, IDeselectHandler, ISelectHandler, ISubmitHandler
{
//public Button[] btns;
//public Slider[] sld;
public void OnDeselect(BaseEventData eventData)
{
Debug.Log("OnDeselect" + eventData.selectedObject.GetComponentInChildren<Button>().name);
}
public void OnSelect(BaseEventData eventData)
{
Debug.Log("OnSelect" + eventData.selectedObject.GetComponentInChildren<Button>().name);
}
public void OnSubmit(BaseEventData eventData)
{
Debug.Log("OnSubmit" + eventData.selectedObject.GetComponent<Button>().name);
}
}