init
This commit is contained in:
commit
862afc9b7a
478 changed files with 197737 additions and 0 deletions
30
Assets/Scripts/WeaponDisplay.cs
Normal file
30
Assets/Scripts/WeaponDisplay.cs
Normal file
|
@ -0,0 +1,30 @@
|
|||
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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue