Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        //Display Cursor
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            showCursor = !showCursor;
            FPController.ChangeCursorState(showCursor);
        }

        //Shoot
        if (Input.GetButton("Fire1"))
        {
            if (Time.time > nextFire)
            {
                nextFire = Time.time + fireRate;
                Fire();
            }
        }

        //UI
        UpdateUI();
    }