Ejemplo n.º 1
0
    public static YHGotRewardCell CreateCellView()
    {
        if (mObj == null)
        {
            mObj = Resources.Load("pbYHGotRewardCell");
        }

        GameObject go = Instantiate(mObj) as GameObject;

        YHGotRewardCell cv = go.GetComponent <YHGotRewardCell>();

        return(cv);
    }
Ejemplo n.º 2
0
    public void FreshRewardCell(List <int[]> lr, bool notGift = false)
    {
        szAllReward = lr;
        int   id;
        int   num;
        float fscale = 1;
        float width  = 110;

        if (lr.Count == 2)
        {
            fscale = _scale2;
            width  = _width2;
        }
        if (lr.Count == 4)
        {
            fscale = _scale4;
            width  = _width4;
        }
        if (lr.Count == 5)
        {
            fscale = _scale5;
            width  = _width5;
        }

        _grid.cellWidth = width;

        for (int i = 0, max = lr.Count; i < max; i++)
        {
            if (lr[i].Length == 2)
            {
                id  = lr[i][0];
                num = lr[i][1];


                YHGotRewardCell cell = YHGotRewardCell.CreateCellView();
                _grid.AddChild(cell.transform);
                cell.transform.localScale = Vector3.one * fscale;
                cell.freshDailyCell(id, num, bDoubleReward);
                if (id == 4001 && notGift)
                {
                    cell.transform.GetChild(0).ESetActive(false);
                }
            }
        }
        _grid.Reposition();
    }