コード例 #1
0
        //Picke Upable Object. When we double click on the object in the scene.
        private void OnMouseDown()
        {
            if (!clickManager.DoubleClick())
            {
                return;
            }

            if (!isInit)
            {
                FetchItemInfo();
            }
            CursorManager.GetInstance().setMouse();
        }
コード例 #2
0
ファイル: DragItem.cs プロジェクト: Visin1991/Unity_Vlib
 //interface of IPointerDownHandler
 public void OnPointerDown(PointerEventData data)
 {
     if (data.button == PointerEventData.InputButton.Left)
     {
         if (clickManager.DoubleClick())
         {
             GetComponent <ItemHandleOnGUI>().DoubleClick();
         }
         ///https://docs.unity3d.com/ScriptReference/RectTransformUtility.ScreenPointToLocalPointInRectangle.html
         //RectTransformUtility.ScreenPointToLocalPointInRectangle(itemObjRectTransform, data.position, data.pressEventCamera, out pointerOffset);
         oldSlot = transform.parent.gameObject;
     }
     if (UpdateInventoryList != null)
     {
         UpdateInventoryList();
     }
 }
コード例 #3
0
        //Picke Upable Object. When we double click on the object in the scene.
        private void OnMouseDown()
        {
            if (!clickManager.DoubleClick())
            {
                return;
            }

            if (!isInit)
            {
                FetchItemInfo();
            }

            //Find Player and Players inventory
            TargetLE    lplayer   = FindObjectOfType <TargetLE>();
            LEInventory inventory = lplayer.transform.GetComponentInChildren <LEInventory>();

            inventory.AddItem(item);
            transform.parent.parent = inventory.transform;
            transform.parent.gameObject.SetActive(false);
            CursorManager.GetInstance().setMouse();
        }