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,8 +1,12 @@
using System.Collections.Generic;
using System.Linq;
using Actions;
using Tiles;
using UnityEngine;
using UnityEngine.EventSystems;
namespace Shop {
public class ShopUI : MonoBehaviour {
public class ShopUI : MonoBehaviour , IPointerEnterHandler, IPointerExitHandler{
public Transform itemsParent;
public Transform animalsParent;
public GameObject shopUI;
@ -81,5 +85,19 @@ namespace Shop {
}
}
}
/**
* 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;
}
}
}