Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        transform.Rotate(0, Input.GetAxis("Horizontal") * turnSpeed * Time.deltaTime, 0);
        Vector3 moveDir = transform.forward * Input.GetAxis("Vertical") * speed;

        controller.Move(moveDir * Time.deltaTime - Vector3.up * .1f);
        if (Input.GetKeyDown(KeyCode.F) && collectableItem)
        {
            Debug.Log(collectableItem.itemName + " F");
            Destroy(collectableItem.gameObject);
            messagePanel.gameObject.SetActive(false);
            collectableItem = null;
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            writer.DisplayStatus();
        }
    }