Exemple #1
0
    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);
        }
    }
Exemple #2
0
 void Start()
 {
     _invItemScript = GetComponent <InvSlotScript>();
 }
 public void Initialize(int index, InvSlotScript scr)
 {
     slot [index] = scr;
 }