Пример #1
0
        private void RenderDict(string dictId, WordDictionary dict)
        {
            float minY = ItemsNode.transform.localPosition.y;

            //Debug.Log("up minY=" + minY);

            foreach (var n in ItemsNode.GetComponentsInChildren <DictionaryNodeBehavior>())
            {
                if (n.gameObject.activeSelf && n.transform.localPosition.y < minY)
                {
                    minY = n.transform.localPosition.y - 100;
                }
            }

            var node = PrefabsHelper.InstantiateDictionaryNode(ItemsNode.transform);

            var item = node.GetComponent <DictionaryNodeBehavior>();

            item.Label.text   = dict.Name;
            item.DictionaryId = dictId;

            minY -= 10;

            Debug.Log("up minY=" + minY);

            node.transform.localPosition = new Vector3(0, minY);

            //Debug.Log("up parent" + ItemsNode.transform);
        }