예제 #1
0
    public void FreshSellGroupWithID(int id1, int id2, int id3, int max)
    {
        maxCount = max;
        itemID1  = id1;
        itemID2  = id2;
        itemID3  = id3;
        WGDataController _dataCtrl = WGDataController.Instance;

        col1       = _dataCtrl.GetCollectionInfo(itemID1);
        col2       = _dataCtrl.GetCollectionInfo(itemID2);
        col3       = _dataCtrl.GetCollectionInfo(itemID3);
        mSellCount = max;
        freshSellView();
    }
    public void InitScrollView()
    {
        if (bInit)
        {
            return;
        }
        bInit     = true;
        _dataCtrl = WGDataController.Instance;


        Dictionary <int, List <int> > dicCollections = new Dictionary <int, List <int> >();

        for (int i = 0; i < _dataCtrl.szCollectionObj.Count; i++)
        {
            BCObj            obj = _dataCtrl.szCollectionObj[i];
            BCCollectionInfo col = _dataCtrl.GetCollectionInfo(obj.ID);
            List <int>       szTemp;
            if (dicCollections.TryGetValue(col.groupID, out szTemp))
            {
                szTemp.Add(obj.ID);
            }
            else
            {
                szTemp = new List <int>();
                szTemp.Add(obj.ID);
                dicCollections.Add(col.groupID, szTemp);
            }
        }
        int index = 0;

        foreach (KeyValuePair <int, List <int> > kvp in dicCollections)
        {
            CItemCollectionCell cell = CItemCollectionCell.CreateCollectionCell();
            cell.transform.parent        = this.transform;
            cell.transform.localScale    = Vector3.one;
            cell.transform.localPosition = new Vector3(0, 200 - index * 236, 0);

            szCollectionCell.Add(cell);

            Color color = Color.gray;
            if (index <= szColors.Length)
            {
                color = szColors[index];
            }
            cell.freshWithCollections(kvp.Value.ToArray(), szColors[index]);
            cell.SetDragCamera(dragCamera);
            index++;
        }
    }
예제 #3
0
    public void freshItem()
    {
        WGDataController _dataCtrl = WGDataController.Instance;


        Dictionary <int, List <int> > dicCollections = new Dictionary <int, List <int> >();

        for (int i = 0; i < _dataCtrl.szCollectionObj.Count; i++)
        {
            BCObj            obj = _dataCtrl.szCollectionObj[i];
            BCCollectionInfo col = _dataCtrl.GetCollectionInfo(obj.ID);
            List <int>       szTemp;
            if (dicCollections.TryGetValue(col.groupID, out szTemp))
            {
                szTemp.Add(obj.ID);
            }
            else
            {
                szTemp = new List <int>();
                szTemp.Add(obj.ID);
                dicCollections.Add(col.groupID, szTemp);
            }
        }
        int  index    = 0;
        bool showTips = false;

        foreach (KeyValuePair <int, List <int> > kvp in dicCollections)
        {
            int [] ids = kvp.Value.ToArray();
            if (ids.Length >= 3)
            {
                int left   = _dataCtrl.GetCollectionOwnNum(ids[0]);
                int center = _dataCtrl.GetCollectionOwnNum(ids[1]);
                int right  = _dataCtrl.GetCollectionOwnNum(ids[2]);
                if (Mathf.Min(left, center, right) > 0)
                {
                    showTips = true;
                    break;
                }
            }
        }
        spItemComplet.ESetActive(showTips);
    }