From bb6cbb4c4d4e4d6ec4755fd711bdbdb6eba57b02 Mon Sep 17 00:00:00 2001 From: excitedneon Date: Wed, 17 May 2017 00:58:04 +0300 Subject: [PATCH] Implement dragging items in inventory properly --- Assets/Scripts/Controls/InventoryInterface.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Controls/InventoryInterface.cs b/Assets/Scripts/Controls/InventoryInterface.cs index 9773911..2b0cd36 100644 --- a/Assets/Scripts/Controls/InventoryInterface.cs +++ b/Assets/Scripts/Controls/InventoryInterface.cs @@ -155,7 +155,6 @@ namespace Cyber.Controls { ItemGridSelectedIndex == CurrentIndex) { // This item has been selected for at least a frame, // and the mouse is moving, this counts as dragging - Debug.Log("Grabbed!"); GrabbedItem = LookedAt.collider.transform; GrabbedItemIndex = CurrentIndex; } @@ -193,8 +192,9 @@ namespace Cyber.Controls { // Reset grabbing GrabbedItem = null; GrabbedItemIndex = -1; + ItemGridSelectedIndex = CurrentIndex; } else { - + ItemGridCellMeshes[GrabbedItemIndex].transform.position = LookedAt.point; } } } else if (Mesh != null) {