Advertisement
Guest User

Untitled

a guest
May 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. public void changeWeapon(bool up)
  2. {
  3. int weaponIndex = (int)character.weapon;
  4. if (up)
  5. {
  6. weaponIndex++;
  7. if (weaponIndex >= Enum.GetNames(typeof(Weapon)).Length)
  8. weaponIndex = 0;
  9. }
  10. else
  11. {
  12. weaponIndex--;
  13. if (weaponIndex < 0)
  14. weaponIndex = Enum.GetNames(typeof(Weapon)).Length -1;
  15. }
  16.  
  17. if (character.charClass == ClassType.Swordsman) {
  18. //character.weapon = swordWeapons
  19. } else if (character.charClass == ClassType.Marksman) {
  20.  
  21. } else {
  22.  
  23. }
  24. character.weapon = (Weapon)weaponIndex;
  25. weapon.text = character.weapon + "";
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement