Extra tooltip exit collider

This commit is contained in:
BOT Alex 2024-04-21 06:36:44 +02:00
parent 323b0ef4c4
commit 0f3cfcc364
2 changed files with 12 additions and 0 deletions

View File

@ -934,6 +934,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
tooltip: {fileID: 7959461870474528235}
ExtraExitCollider: {fileID: 3164206115851743815}
ButtonIndex: -1
--- !u!1 &1444386719009988973
GameObject:
@ -1667,6 +1668,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
tooltip: {fileID: 8584771696634545955}
ExtraExitCollider: {fileID: 3164206115851743815}
ButtonIndex: -1
--- !u!1 &3452371300238378862
GameObject:
@ -3072,6 +3074,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
tooltip: {fileID: 2899067781696711495}
ExtraExitCollider: {fileID: 3164206115851743815}
ButtonIndex: -1
--- !u!1 &5621856367784821633
GameObject:
@ -3950,6 +3953,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
tooltip: {fileID: 4502190811754076786}
ExtraExitCollider: {fileID: 3164206115851743815}
ButtonIndex: -1
--- !u!1 &8438906130455969465
GameObject:
@ -4546,6 +4550,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
tooltip: {fileID: 1475988817490299594}
ExtraExitCollider: {fileID: 3164206115851743815}
ButtonIndex: -1
--- !u!1001 &1148800059794808287
PrefabInstance:

View File

@ -10,6 +10,7 @@ public class UITooltips : MonoBehaviour
// Not optimal but gamejam momento
[SerializeField] private GameObject tooltip;
[SerializeField] private EventTrigger ExtraExitCollider;
private EventTrigger uiEvents;
public int ButtonIndex = -1;
@ -29,6 +30,12 @@ public class UITooltips : MonoBehaviour
pointerEnter.callback.AddListener((data) => { OnEnter((PointerEventData)data); });
uiEvents.triggers.Add(pointerEnter);
// Subscribe to PointerEnter event
EventTrigger.Entry ExtraExitEnter = new EventTrigger.Entry();
ExtraExitEnter.eventID = EventTriggerType.PointerEnter;
ExtraExitEnter.callback.AddListener((data) => { OnExit((PointerEventData)data); });
ExtraExitCollider.triggers.Add(ExtraExitEnter);
// Subscribe to PointerExit event
EventTrigger.Entry pointerExit = new EventTrigger.Entry();
pointerExit.eventID = EventTriggerType.PointerExit;