summaryrefslogtreecommitdiff
path: root/GameCode/CardBarButton.cs
diff options
context:
space:
mode:
Diffstat (limited to 'GameCode/CardBarButton.cs')
-rw-r--r--GameCode/CardBarButton.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/GameCode/CardBarButton.cs b/GameCode/CardBarButton.cs
new file mode 100644
index 0000000..13d9c62
--- /dev/null
+++ b/GameCode/CardBarButton.cs
@@ -0,0 +1,19 @@
+using UnityEngine;
+using UnityEngine.EventSystems;
+
+public class CardBarButton : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler
+{
+ internal CardInfo card;
+
+ public void OnPointerEnter(PointerEventData eventData)
+ {
+ GetComponentInParent<CardBar>().OnHover(card, base.transform.position);
+ base.transform.localScale = Vector3.one * 1.1f;
+ }
+
+ public void OnPointerExit(PointerEventData eventData)
+ {
+ GetComponentInParent<CardBar>().StopHover();
+ base.transform.localScale = Vector3.one * 1f;
+ }
+}