public void OnPointerDown(PointerEventData eventData) { if (Input.GetMouseButtonDown(0))// still spawns when drag scroll { if (ItemScript.selectedItem == null) { SpawnStoredItem(); //swap item when no selectedButton and selectedItem } listManager.AddSelectedItemToList(); if (ItemScript.selectedItem != null && invenManager.selectedButton != this.gameObject) // reset selected button when item is from list { invenManager.selectedButton.GetComponent <CanvasGroup>().alpha = 1f; invenManager.selectedButton = null; listManager.itemEquipPool.ReturnObject(ItemScript.selectedItem); SpawnStoredItem(); } } }