void UpdateInfo() { GameObject inspectedItem = _inspectedItem.Value; if (inspectedItem != null) { InvSlotScript invItemScript = inspectedItem.GetComponent <InvSlotScript>(); if (invItemScript != null && invItemScript.RepresentedItem != null) { nameText.text = invItemScript.RepresentedItem.Template.Name; descText.text = invItemScript.RepresentedItem.Template.Description; gameObject.SetActive(true); transform.position = inspectedItem.transform.position; } } else { gameObject.SetActive(false); } }
void Start() { _invItemScript = GetComponent <InvSlotScript>(); }
public void Initialize(int index, InvSlotScript scr) { slot [index] = scr; }