Exemplo n.º 1
0
    IEnumerator Reload()
    {
        canAttack = false;
        int availableAmmo = CheckReload();

        if (currentWeapon.bulletInMagazine < currentWeapon.magazineCapacity &&
            availableAmmo > currentWeapon.bulletInMagazine)
        {
            currentWeapon.Reload(availableAmmo);
            yield return(new WaitForSeconds(2f));
        }
        canAttack = true;
        UIAmmoWeapon(currentWeapon);
    }
Exemplo n.º 2
0
 public override void AlternativeUse(PlayerCharacter by, InteractableObject target = null)
 {
     // Reload
     _weaponInstance.Reload(by);
     photonView.RPC("OnReload_RPC", RpcTarget.All);
 }