Working on inventory 2
This commit is contained in:
parent
fd71606833
commit
eb61f607b1
3 changed files with 23 additions and 4 deletions
Binary file not shown.
|
@ -7,7 +7,7 @@ public class Inventory : MonoBehaviour
|
|||
{
|
||||
public Image[] itemImages = new Image[numItemSlots];
|
||||
public Item[] items = new Item[numItemSlots];
|
||||
public const int numItemSlots = 6;
|
||||
public const int numItemSlots = 25;
|
||||
public void AddItem(Item itemToAdd)
|
||||
{
|
||||
for (int i = 0; i < items.Length; i++)
|
||||
|
|
|
@ -5,12 +5,31 @@ using System.Text;
|
|||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class MonsterManager : MonoBehaviour {
|
||||
|
||||
public GameObject inventory;
|
||||
public Item item;
|
||||
|
||||
void Start() {
|
||||
|
||||
private Inventory inv;
|
||||
|
||||
void Start()
|
||||
{
|
||||
inv = FindObjectOfType<Inventory> ();
|
||||
giveItem (item);
|
||||
}
|
||||
|
||||
public void saveMonster ()
|
||||
public void giveItem(Item itm)
|
||||
{
|
||||
inv.AddItem (itm);
|
||||
}
|
||||
|
||||
public void showItems()
|
||||
{
|
||||
if (inventory.activeSelf == false)
|
||||
inventory.SetActive (true);
|
||||
else inventory.SetActive (false);
|
||||
}
|
||||
|
||||
public void saveMonster()
|
||||
{
|
||||
StringBuilder eyePos = new StringBuilder();
|
||||
|
||||
|
|
Reference in a new issue