Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class inventory : MonoBehaviour {
  4. public int maxItemSlots = 5;
  5. public int ausgewählterSlot = 1;
  6. public bool ausgewählterMainSlot1 =true;
  7. public bool ausgewählterMainSlot2 =false;
  8. public bool ausgewählterMainSlot3 =false;
  9. public bool ausgewählterMainSlot4 =false;
  10. public bool ausgewählterMainSlot5 =false;
  11. private angriff at;
  12. void Start () {
  13. at = GameObject.FindGameObjectWithTag ("angriff").GetComponent<angriff>();
  14. }
  15.  
  16. // Update is called once per frame
  17. void Update ()
  18. {
  19. if (Input.GetAxis ("Mouse ScrollWheel") > 0f) { // forward
  20. ausgewählterSlot += 1;
  21. } else if (Input.GetAxis ("Mouse ScrollWheel") < 0f) { // backwards
  22. ausgewählterSlot -= 1;
  23. }
  24. if (ausgewählterSlot <= 0f) {
  25. ausgewählterSlot += 5;
  26. }
  27. if (ausgewählterSlot > 5f) {
  28. ausgewählterSlot -= 5;
  29. }
  30. if (ausgewählterSlot == 1){
  31. compareTag("1") = ausgewöhltherMainSlot;
  32. }
  33. if (ausgewählterSlot == 2){
  34. compareTag("2") = ausgewöhltherMainSlot;
  35. }
  36. if (ausgewählterSlot == 3){
  37. compareTag("3") = ausgewöhltherMainSlot;
  38. }
  39. if (ausgewählterSlot == 4){
  40. compareTag("4") = ausgewöhltherMainSlot;
  41. }
  42. if (ausgewählterSlot == 5){
  43. compareTag("5") = ausgewöhltherMainSlot;
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement