Hey Guys having a problem getting my get/set to work and not sure why cause I’ve had working before.
Item is a scriptable object and the script is attached to a UI component if that has anything to do with it
None of the debugs are showing up in console either.
public class ItemSlot : MonoBehaviour
{
[SerializeField] public Item m_slotItem;
[SerializeField] private Image slotIcon;
[SerializeField] [ExecuteInEditMode] public Item SlotItem
{
get
{
Debug.Log("1");
return m_slotItem;
}
set
{
m_slotItem = value;
Debug.Log("2");
if(m_slotItem == null)
{
slotIcon = InvUIManager.singleton.EmptyIcon;
return;
}
slotIcon.sprite = m_slotItem.invIcon;
}
}
}
Would appreciate any information or any links to anything I might have missed