Hands.Drop C# (CSharp) Method

Drop() public method

public Drop ( ) : void
return void
    public void Drop()
    {
    }

Usage Example

Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKey(KeyCode.Escape))
        {
            Cursor.lockState = CursorLockMode.None;
        }

        Turning();
        InteractCast();

        if (Input.GetButtonDown("Fire1"))
        {
            if (Time.timeScale == 1)
            {
                Cursor.lockState = CursorLockMode.Locked;
            }

            if (canInteract)
            {
                interactTarget.transform.GetComponent <Interactable>().Interact();
            }
            else if (canPlace)
            {
                hands.Place(interactTarget.transform);
            }
            else if (canMove)
            {
                hands.Pickup(interactTarget.transform.GetComponent <Moveable>());
            }
            else
            {
                hands.Drop();
            }
        }
    }