WeaponManager.GetCurrentWeapon C# (CSharp) Method

GetCurrentWeapon() public method

public GetCurrentWeapon ( ) : PlayerWeapon,
return PlayerWeapon,
    public PlayerWeapon GetCurrentWeapon()
    {
        return currentWeapon;
    }

Usage Example

Beispiel #1
0
    private void Update()
    {
        SetHealthAmount(player.GetHealthPct());
        if (!weaponManager.isReloading)
        {
            SetAmmoAmount(weaponManager.GetCurrentWeapon().bullets, weaponManager.GetCurrentWeapon().maxBullets);
        }
        else
        {
            SetAmmoAmount(0, weaponManager.GetCurrentWeapon().maxBullets);
        }
        if (Input.GetKeyDown(KeyCode.Tab))
        {
            scoreboard.SetActive(true);
        }
        else if (Input.GetKeyUp(KeyCode.Tab))
        {
            scoreboard.SetActive(false);
        }

        if (Input.GetKeyDown(KeyCode.R) && !weaponManager.isReloading)
        {
            weaponManager.Reload();
        }
    }
All Usage Examples Of WeaponManager::GetCurrentWeapon