using System.Linq; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UIElements; public class InventoryScreenInvoker : MonoBehaviour, IPointerClickHandler { public InventoryHolder SourceInventory; public InventoryHolder TargetInventory; public void OnPointerClick(PointerEventData eventData) { Show(); } private void Show() { var inventoryScreen = FindObjectsByType(FindObjectsSortMode.None).First(); if (inventoryScreen == null) { Debug.Log("No inventory screen defined on current scene"); return; } inventoryScreen.Display(SourceInventory, TargetInventory); } }