Ejemplo n.º 1
0
 void InitCell()
 {
     if (mTrans == null)
     {
         mTrans = transform;
     }
     if (myTableView == null)
     {
         myTableView = NGUITools.FindInParents <WGTableView>(mTrans);
     }
 }
Ejemplo n.º 2
0
    public WGTableViewCell WGTableViewCellWithIndex(WGTableView scrView, int index)
    {
        WGTableViewCell cell = scrView.getCacheCellsWithIdentifier(mIdentifier);

        CShopScrollCell tCell;

        if (cell == null)
        {
            tCell           = CShopScrollCell.CreateShopScrollCell();
            cell            = tCell as WGTableViewCell;
            cell.identifier = mIdentifier;
        }
        else
        {
            tCell = cell as CShopScrollCell;
        }
        tCell.index = index;

        tCell.freshShopItem(index, szShopData[index]);

        return(cell);
    }
Ejemplo n.º 3
0
    //	根据index获得一个cell,在实现的时候,需要通过 scrView.getCacheCellsWithIdentifier(identifier)获取缓存里面的Cell如果没有,在生成一个新的.
    public WGTableViewCell WGTableViewCellWithIndex(WGTableView scrView, int index)
    {
        WGTableViewCell cell = scrView.getCacheCellsWithIdentifier(1);

        WGTestCell tCell;

        if (cell == null)
        {
            GameObject go = createCell();
            tCell           = go.GetComponent <WGTestCell>();
            cell            = tCell as WGTableViewCell;
            cell.identifier = 1;
        }
        else
        {
            tCell = cell as WGTestCell;
        }
        tCell.index = index;

        tCell.freshWithIndex(index);

        return(cell);
    }
Ejemplo n.º 4
0
    public WGTableViewCell WGTableViewCellWithIndex(WGTableView scrView, int index)
    {
        WGTableViewCell cell = scrView.getCacheCellsWithIdentifier(1);

        CAchievementCell tCell;

        if (cell == null)
        {
            tCell                   = CAchievementCell.CreateAchievementCell();
            cell                    = tCell as WGTableViewCell;
            cell.identifier         = 1;
            tCell.curAchViewManager = this;
        }
        else
        {
            tCell = cell as CAchievementCell;
        }
        tCell.index = index;
        MDAchievement ach;

        if (index < szReached.Count)
        {
            ach = szReached[index];
        }
        else if (index < szReached.Count + szNoReached.Count)
        {
            ach = szNoReached[index - szReached.Count];
        }
        else
        {
            ach = szHaveGot[index - szReached.Count - szNoReached.Count];
        }
        tCell.freshUIWithData(ach);

        return(cell);
    }