예제 #1
0
    private void PopulateListItem(Node node, int nodeIndex)
    {
        listItens = node.GetListItens();

        for (int i = 0; i < listItens.Count; i++)
        {
            GameObject newObject = Instantiate(buttonsPrefabs[1], panelInteraction.transform);
            ItemButton pointer   = newObject.GetComponent <ItemButton>();

            pointer.SetController(this);
            pointer.SetParentNode(listNodes[i]);
            pointer.SetParentIndex(nodeIndex);
            pointer.SetItem(listItens[i]);
            pointer.SetIndex(i);

            itenButtonList.Add(newObject);
        }
    }