Train-of-Thought/Assets/Scripts/WeaponDisplay.cs
Gerard Gascón 862afc9b7a init
2025-04-24 16:56:52 +02:00

30 lines
733 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WeaponDisplay : MonoBehaviour
{
public GameObject addWeap;
public Image weaponDisplay;
//public GameObject addWeap2;
// Start is called before the first frame update
void Start()
{
Inventory.addItem(addWeap);
//Inventory.addItem(addWeap2);
}
// Update is called once per frame
void Update() {
if (Inventory.Items.Count > 0) {
weaponDisplay.sprite = Inventory.getActiveItem().GetComponentInChildren<SpriteRenderer>().sprite;
}
}
public void nextWeapon() {
Debug.Log("nextwep");
Inventory.cycleItem();
}
}