Example #1
0
    public void OnEndDrag(PointerEventData eventData)
    {
        //Debug.Log(fromX.ToString() + ";" + fromY.ToString() + ";" + toX.ToString() + ";" + toY.ToString() + ";" + itemWidth.ToString() + ";" + itemHeight.ToString());


        //if (!player.CanPuteHere(toX, toY, itemWidth, itemHeight))
        if (!player.CanPuteHere(itemToMove, toX, toY))
        {
            player.CreateInventory();
        }
        else
        {
            player.MoveItem(itemToMove, toX, toY);
        }
        // GetComponent<RectTransform>().localPosition = new Vector3(toX * 20 + 10, toY * -20 - 10, 0);

        //image.color = new Color(1, 1, 1, 1);
    }
Example #2
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Tab) && elampsedTime > delay)
        {
            if (!playerInv.isVisible)
            {
                Debug.Log("show");
                playerInv.CreateInventory();
            }
            else
            {
                Debug.Log("hide");

                playerInv.Destroy();
            }

            elampsedTime = 0;
        }
        elampsedTime += Time.deltaTime;
    }