Ejemplo n.º 1
0
    private void UpdateWeaponInfo(IEquippedWeapon currentWeapons)
    {
        builder.Remove(0, builder.ToString().Length);
        if (currentWeapons.IsMeleeEquipment)
        {
            builder.Append(currentWeapons.CurrentMeleeWeapon.WeaponInfo.WeaponName);

            if (currentWeapons.CurrentRangedWeapon != null)
            {
                builder.Append(concatenationStyle);
                builder.Append(currentWeapons.CurrentRangedWeapon.WeaponInfo.WeaponName);
                weaponNameHolder.text = builder.ToString();
                builder.Remove(0, builder.ToString().Length);

                ammoHolder.text = CurrentAmmoOutputStyle
                                      (currentWeapons.CurrentRangedWeapon.WeaponInfo.CurrentAmmoInMagazine,
                                      ammoSeparator,
                                      currentWeapons.CurrentRangedWeapon.WeaponInfo.CurrentAmmoMax);
            }
            else
            {
                weaponNameHolder.text = builder.ToString();
            }
        }
        else
        {
            weaponNameHolder.text = currentWeapons.CurrentRangedWeapon.WeaponInfo.WeaponName;
            ammoHolder.text       = CurrentAmmoOutputStyle
                                        (currentWeapons.CurrentRangedWeapon.WeaponInfo.CurrentAmmoInMagazine,
                                        ammoSeparator,
                                        currentWeapons.CurrentRangedWeapon.WeaponInfo.CurrentAmmoMax);
        }
    }
Ejemplo n.º 2
0
 private void UpdateRangedWeaponAmmoText(IEquippedWeapon currentWeapons)
 {
     if (currentWeapons.CurrentRangedWeapon != null && builder != null)
     {
         builder.Remove(0, builder.ToString().Length);
         ammoHolder.text = CurrentAmmoOutputStyle
                               (currentWeapons.CurrentRangedWeapon.WeaponInfo.CurrentAmmoInMagazine,
                               ammoSeparator,
                               currentWeapons.CurrentRangedWeapon.WeaponInfo.CurrentAmmoMax);
     }
 }
Ejemplo n.º 3
0
    // TODO input elements for the invertory
    public Invertory(List <IEquippedWeapon> weapons)
    {
        this.weaponIndex = 0;
        this.weapons     = weapons;
        currentWeapons   = new EquippedWeapon();
        currentWeapons.CurrentMeleeWeapon  = this.weapons[weaponIndex].CurrentMeleeWeapon;
        currentWeapons.CurrentRangedWeapon = this.weapons[weaponIndex].CurrentRangedWeapon;

        if (currentWeapons.CurrentMeleeWeapon != null)
        {
            currentWeapons.CurrentMeleeWeapon.PlaceWeapon(false);
        }
        if (currentWeapons.CurrentRangedWeapon != null)
        {
            currentWeapons.CurrentRangedWeapon.PlaceWeapon(false);
        }
    }