Пример #1
0
    private void OnMouseDrag()
    {
        // Make the item visible and large for the player
        collectible.AppearInInventory();

        // Move the parent transform to whereever the player drags to, smoothly.
        mouseDrag     = true;
        mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        Vector3 dragPosition = new Vector3(mousePosition.x - smoothPosition.x, 0f, mousePosition.z - smoothPosition.z);

        parent.transform.position = dragPosition;
    }