-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathClickableObject.cs
More file actions
32 lines (23 loc) · 811 Bytes
/
Copy pathClickableObject.cs
File metadata and controls
32 lines (23 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using UnityEngine;
using UnityEngine.EventSystems;
public class ClickableObject : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
{
public int mIdObject;
private ButtonsGroupController _mButtonsGroupController;
void Start()
{
_mButtonsGroupController = transform.parent.GetComponent<ButtonsGroupController>(); ;
}
public void OnPointerClick(PointerEventData eventData)
{
_mButtonsGroupController.NotifySelection(mIdObject);
}
public void OnPointerEnter(PointerEventData pointerEventData)
{
_mButtonsGroupController.NotifyHovering(mIdObject);
}
public void OnPointerExit(PointerEventData pointerEventData)
{
_mButtonsGroupController.NotifyStoppedHovering(mIdObject);
}
}