Exemplo n.º 1
0
    private void UpdateItemUI()
    {
        if (itemsArray.Retrieve(currentSelectedItem) != null)
        {
            ActivateableItems itemOnCurrentSpot = itemsArray.Retrieve(currentSelectedItem);

            if (itemOnCurrentSpot.transform.parent != Camera.main.transform)
            {
                itemOnCurrentSpot.transform.SetParent(Camera.main.transform);
            }

            itemOnCurrentSpot.MoveToActive(position0Items);
        }

        //Set extra items as inactive

        ItemNode currentNode = itemsArray.root;

        while (currentNode != null)
        {
            if (currentNode.Index != currentSelectedItem)
            {
                currentNode.storedItem.Deactivate();
            }
            currentNode = currentNode.nextNode;
        }
    }