public void ChangeWeapons(bool direction) { if (direction) { if (equippedWeaponIndex + 1 >= weapons.Count) { equippedWeaponIndex = 0; } else { equippedWeaponIndex += 1; } } else { if (equippedWeaponIndex - 1 < 0) { equippedWeaponIndex = weapons.Count - 1; } else { equippedWeaponIndex -= 1; } } equippedWeapon.Unequip(); equippedWeapon = weapons[equippedWeaponIndex]; equippedWeapon.Equip(); }