Example #1
0
 public void OnDrag(PointerEventData eventData)
 {
     //Debug.Log("button down: " + eventData.button);
     if (eventData.button.ToString() == "Right")
     {
         InventoryUIManager.CreateItemMenu(this);
     }
     else
     {
         Vector2 newPos = Input.mousePosition - mouseoffset;
         float   newX   = Mathf.Min(Mathf.Max(0f, newPos.x), Screen.width);
         float   newY   = Mathf.Min(Mathf.Max(0f, newPos.y), Screen.height);
         transform.position    = new Vector3(newX, newY, 0f);
         m_image.raycastTarget = false;
     }
 }