NO LONGER CLICK THROUGH UI OMG

This commit is contained in:
dhain 2022-06-24 08:38:28 +02:00
parent d3a06effc5
commit 4a8067d3d7
7 changed files with 76 additions and 28 deletions

View file

@ -1,9 +1,10 @@
using System;
using System.Linq;
using Actions;
using UnityEngine;
using UnityEngine.EventSystems;
public class InventoryUI : MonoBehaviour {
public class InventoryUI : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler {
public Transform itemsParent;
public GameObject inventoryUI;
private Inventory _inventory;
@ -59,4 +60,18 @@ public class InventoryUI : MonoBehaviour {
}
}
}
/**
* Turn off ActionManager when Pointer over UI
*/
public void OnPointerEnter(PointerEventData eventData) {
ActionManager.Instance.Enabled = false;
}
/**
* Turn on ActionManager when Pointer over UI
*/
public void OnPointerExit(PointerEventData eventData) {
ActionManager.Instance.Enabled = true;
}
}