Doesn’t make any difference, but I like to make my code a bit more compact (assuming it doesn’t degrade readability).
For example:
weapon.gameObject.SetActive(weaponIndex == currentWeapon);
This allows us to do away with the if/else blocks.
Doesn’t make any difference, but I like to make my code a bit more compact (assuming it doesn’t degrade readability).
For example:
weapon.gameObject.SetActive(weaponIndex == currentWeapon);
This allows us to do away with the if/else blocks.
If you find that line of code readable, feel free to use it.