Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F))
        {
            Debug.Log(holder.isHolding);
        }
        if (holder.isHolding)
        {
            holder.updatePosition(transform.position + Vector3.up);

            if (Input.GetKeyDown(KeyCode.F))
            {
                Fire();
            }
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        if (holding.isHolding)
        {
            holding.updatePosition(transform.position + transform.forward + transform.up);
        }

        if (Input.GetKeyDown(KeyCode.E) && holding.isHolding)
        {
            holding.releaseItem(Camera.main.transform.forward);
        }
        else if (Input.GetKeyDown(KeyCode.E) && holding.canPickUp)
        {
            holding.pickUp(transform.position + transform.forward);
        }

        if (health <= 0)
        {
            Debug.Log("you died, rip");
            Time.timeScale = 0.0f;
        }
    }