Item Gedöns bissl benüüüützen

This commit is contained in:
brausjonas
2023-03-04 00:25:41 +01:00
parent 32f5b49c0d
commit fd0a36ccb7
11 changed files with 974 additions and 98 deletions
+10 -1
View File
@@ -23,6 +23,7 @@ public abstract class Player : MonoBehaviour
public UIHandler uiHandler;
public Item[] items = new Item[3];
public Image[] uiItems;
public Item.Type activeItem = Item.Type.None;
//for coin animation
private AnimationHandler animationHandler;
@@ -84,11 +85,19 @@ public abstract class Player : MonoBehaviour
{
items[i] = item;
uiItems[i].sprite = item.sprite;
uiItems[i].gameObject.SetActive(true);
break;
}
}
}
public void ActivateItem(int index, Item.Type type)
{
uiItems[index].gameObject.SetActive(false);
items[index] = null;
activeItem = type;
}
public void OnTriggerEnter(Collider c)
{
eventstop = true;