Inheritance: UnityEngine.MonoBehaviour
Example #1
0
        /// <summary>
        /// Test fill level items
        /// </summary>
        private void FillLevelItems()
        {
            int totalItemsCount = trsLevelItemsParent.childCount;

            for (int i = 0; i < totalItemsCount; i++)
            {
                Transform trs = trsLevelItemsParent.GetChild(i);

                if (trs.childCount > 0)
                {
                    continue;
                }
                GameObject  item       = NGUITools.AddChild(trs.gameObject, levelItem);
                UILevelItem itemScript = item.GetComponent <UILevelItem>();
                itemScript.SetData(this.levelNames[i], UnityEngine.Random.Range(0, 4));
            }
        }
Example #2
0
        /// <summary>
        /// Test fill level items
        /// </summary>
        private void FillLevelItems()
        {
            int totalItemsCount = trsLevelItemsParent.childCount;

            for (int i = 0; i < totalItemsCount; i++)
            {
                Transform trs = trsLevelItemsParent.GetChild(i);

                if (trs.childCount > 0)
                {
                    continue;
                }
                GameObject  item       = NGUITools.AddChild(trs.gameObject, levelItem);
                UILevelItem itemScript = item.GetComponent <UILevelItem>();
                itemScript.SetData("Level" + trs.name);
            }
        }