Esempio n. 1
0
        public GameObject addItem <T>(ListItemBase <T> obj)
        {
            GameObject item = ResourceManager.getInstance().loadUISpawnPool(obj.getPrefab(), treeGrid.gameObject);

            UIEventListener.Get(item).onClick = myOnClick;
            obj.setValue(item);
            treeGrid.repositionNow = true;
            treeGrid.Reposition();
            scrollView.UpdateScrollbars(true);

            itemDic.Add(item, obj);
            SingleTwinSprite <T>(treeGrid.GetChildList());
            return(item);
        }
Esempio n. 2
0
 /// <summary>
 /// 设置单双列表单双背景颜色
 /// </summary>
 private void SingleTwinSprite <T>(List <Transform> objs)
 {
     for (int i = 0; i < objs.Count; i++)
     {
         ListItemBase <T> item = (ListItemBase <T>)itemDic[objs[i].gameObject];
         if (i % 2 == 0)
         {
             item.setUISprite(getSpriteName(true));
         }
         else
         {
             item.setUISprite(getSpriteName(false));
         }
     }
 }