Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- public class inventory : MonoBehaviour {
- public int maxItemSlots = 5;
- public int ausgewählterSlot = 1;
- public bool ausgewählterMainSlot1 =true;
- public bool ausgewählterMainSlot2 =false;
- public bool ausgewählterMainSlot3 =false;
- public bool ausgewählterMainSlot4 =false;
- public bool ausgewählterMainSlot5 =false;
- private angriff at;
- void Start () {
- at = GameObject.FindGameObjectWithTag ("angriff").GetComponent<angriff>();
- }
- // Update is called once per frame
- void Update ()
- {
- if (Input.GetAxis ("Mouse ScrollWheel") > 0f) { // forward
- ausgewählterSlot += 1;
- } else if (Input.GetAxis ("Mouse ScrollWheel") < 0f) { // backwards
- ausgewählterSlot -= 1;
- }
- if (ausgewählterSlot <= 0f) {
- ausgewählterSlot += 5;
- }
- if (ausgewählterSlot > 5f) {
- ausgewählterSlot -= 5;
- }
- if (ausgewählterSlot == 1){
- compareTag("1") = ausgewöhltherMainSlot;
- }
- if (ausgewählterSlot == 2){
- compareTag("2") = ausgewöhltherMainSlot;
- }
- if (ausgewählterSlot == 3){
- compareTag("3") = ausgewöhltherMainSlot;
- }
- if (ausgewählterSlot == 4){
- compareTag("4") = ausgewöhltherMainSlot;
- }
- if (ausgewählterSlot == 5){
- compareTag("5") = ausgewöhltherMainSlot;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement