using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class InventoryButton : MonoBehaviour, IPointerClickHandler { public int slotIndex; private InventoryUI inventoryUI; public void ButtonInit(InventoryUI inventoryUI, int slotIndex) { this.inventoryUI = inventoryUI; this.slotIndex = slotIndex; } public void OnPointerClick(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Left) { if (inventoryUI != null) { inventoryUI.DisplayButtonOptions(transform.position, slotIndex); } } else if (eventData.button == PointerEventData.InputButton.Right) { //inventoryUI.SplitStack(); } } // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } }