I have a c# script like this
void AddWeaponRock () {
if (currentWeapon4 == "") {
currentWeapon4 = "Rock";
}
if (currentWeapon4 != "" && currentWeapon5 == "") {
currentWeapon5 = "Rock";
}
if (currentWeapon4 != "" && currentWeapon5 != "" && currentWeapon6 == "") {
currentWeapon6 = "Rock";
}
I want to change my weapon in sequence.
Example if I already have weapon in slot currentWeapon5 I want to add it to 6. But if i dont have weapon in currentWeapon4 I want to add in currentWeapon4.
The problem is all of currentWeapon4 - 6 change their value to “Rock”
How to solve this ??
Thanks