worked on inventory hover
This commit is contained in:
parent
59e46eb4ab
commit
bc9af1d8d5
5 changed files with 58 additions and 20 deletions
|
|
@ -1,11 +1,16 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.PlayerLoop;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class InventorySlot : MonoBehaviour {
|
||||
public Image icon;
|
||||
|
||||
private Item _item;
|
||||
|
||||
private void Start() {
|
||||
Physics.queriesHitTriggers = true;
|
||||
}
|
||||
|
||||
public void AddItem(Item newItem) {
|
||||
_item = newItem;
|
||||
|
||||
|
|
@ -32,4 +37,14 @@ public class InventorySlot : MonoBehaviour {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
public void OnMouseOver() {
|
||||
icon.sprite = _item.selectedSprite;
|
||||
Debug.Log("Mouse Over Slot");
|
||||
}
|
||||
//TODO: OnMouse Methods not working :'(
|
||||
public void OnMouseExit() {
|
||||
icon.sprite = _item.defaultSprite;
|
||||
Debug.Log("Mouse Exit Slot");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue