I’ve written a script for my inventory, got it all working except I need to only allow one mouse button to move the item?
I’m currently using Event.current.type == EventType.MouseDrag
as my method of dragging and item and Event.current.type == EventType.MouseUp
to drop the item into another slot.
However I would like to restrict the button that can “Cut” the object from its current slot, at current it allows (On windows) Mouse 0, 1 and 2 to “cut” the object and when released will “paste” the object onto a new slot, whereas I would prefer it to only be Mouse 0 (Left click) so I can utilise Mouse 1 (Right?) as my method of displaying a menu.
So the question is, can I restrict a Mouse button on MouseDrag?
PS: I did think a method such as:
if(Input.MouseButtonDown(0){
//ClickyDraggy
if(Event.current.type == EventType.MouseDrag){
..........
}
}
if(Input.MouseButtonDown(1){
GUI.Box(getRekt, "", Skin.GetStyle("Menu");
}