/// <summary> /// Called by Interfacable when this Player ends an ItemStack drag. /// </summary> public void OnEndDrag(Interfacable i) { if (m_endDragDrop != null) { MouseDrag drag = new MouseDrag(m_startDragDrop.Index, m_endDragDrop.Index, m_dragButton); ExecuteDragCommand(drag); } m_dragButton = MouseButton.None; }
/// <summary> /// Called by Interfacable when this PLayer first moves their mouse after clicking down. /// </summary> public void OnBeginDrag(Interfacable i) { if (Input.GetMouseButtonDown(0) || Input.GetMouseButton(0)) { m_dragButton = MouseButton.Left; } else if (Input.GetMouseButtonDown(1) || Input.GetMouseButton(1)) { m_dragButton = MouseButton.Right; } else { m_dragButton = MouseButton.Unknown; } }
/// <summary> /// Called by Interfacable when this PLayer clicks down on an Inventory item. /// </summary> public void OnPointerDown(Interfacable i) { m_startDragDrop = i.gameObject.GetComponentInParent <Dropzone>(); }