private void LeanSelectable_OnDeselectGlobal(LeanSelectable obj) { var item = obj.GetComponent <InventoryItem>(); _globalEvents.ItemDeselectedEvent.Invoke(item); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); var raycasts = Physics.RaycastAll(ray, 100); { if (raycasts.Any(x => x.collider.tag == "Bag")) // If pointer is over bag { _globalEvents.ItemDroppedToBagEvent.Invoke(item); return; } } if (item.IsInBag) { _globalEvents.ItemRemovedFromBagEvent.Invoke(item); } }
private void LeanSelectable_OnSelectGlobal(LeanSelectable arg1, LeanFinger arg2) { _globalEvents.ItemSelectedEvent.Invoke(arg1.GetComponent <InventoryItem>()); }