예제 #1
0
        private void Update()
        {
            currentWeapon = weaponManager.GetCurrentWeapon();

            if (currentWeapon.bullets < currentWeapon.maxBullets)
            {
                if (Input.GetKeyDown(KeyCode.R))
                {
                    weaponManager.Reload();
                    return;
                }
            }

            if (currentWeapon.fireRate <= 0f)
            {
                if (Input.GetMouseButtonDown(0))
                {
                    Shoot();
                }
            }
            else
            {
                if (Input.GetMouseButtonDown(0))
                {
                    InvokeRepeating("Shoot", 0f, 1f / currentWeapon.fireRate);
                }
                else if (Input.GetMouseButtonUp(0))
                {
                    CancelInvoke("Shoot");
                }
            }
        }
        private void Update()
        {
            currentWeapon = weaponManager.GetCurrentWeapon();

            if (currentWeapon.fireRate <= 0f)
            {
                if (Input.GetMouseButtonDown(0))
                {
                    Shoot();
                }
            }
            else
            {
                if (Input.GetMouseButtonDown(0))
                {
                    InvokeRepeating("Shoot", 0f, 1f / currentWeapon.fireRate);
                }
                else if (Input.GetMouseButtonUp(0))
                {
                    CancelInvoke("Shoot");
                }
            }
        }
예제 #3
0
 private void Update()
 {
     SetFuelAmount(controller.GetThrusterFuelAmount());
     SetHealthAmount(player.GetHealthPctg());
     SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets);
 }