30 lines
733 B
C#
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();
|
|
}
|
|
}
|