OnMouseDown и д.р не работают Unity
Всем привет.
Я делаю инвентарь и появилась проблема:
OnMouseDown,OnMouseEnter, OnMouseExit не работают в Canvas(Screen Space - Overlay), но прекрасно работают в Canvas(Screen Space - Camera, Canvas(World Space).
Я уже пробовал слои менять, размеры колайдеров, ось z. Вроде бы колайдер другие колайдеры не закрывают. Зараннее спасибо!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class InventorySlot : MonoBehaviour
{
public ItemsInventory.Item item;
public Image image;
public InventoryManager inventoryManager;
public UIControl uiControl;
private void Awake()
{
inventoryManager = GameObject.FindObjectOfType<InventoryManager>().gameObject.GetComponent<InventoryManager>();
uiControl = GameObject.FindObjectOfType<UIControl>().gameObject.GetComponent<UIControl>();
}
public void UpdateItem()
{
if(item != null)
{
image.sprite = item.spriteItem;
}
else
{
image.sprite = null;
}
}
private void OnMouseEnter()
{
Debug.Log("E");
if(item != null) inventoryManager.ItemNameDesc(item.nameItem, item.descriptionItem);
}
private void OnMouseExit()
{
inventoryManager.ItemNameDesc("", "");
}
private void OnMouseOver()
{
if (Input.GetMouseButtonDown(0))
{
if (item != null)
{
item.Use(uiControl);
item = null;
UpdateItem();
}
}
if(Input.GetMouseButtonDown(1))
{
if (inventoryManager.itemInHand != null)
{
item = inventoryManager.itemInHand;
inventoryManager.itemInHand = null;
UpdateItem();
}
else if (inventoryManager.itemInHand == null)
{
inventoryManager.itemInHand = item;
item = null;
UpdateItem();
}
}
}
}