Ejemplo n.º 1
0
    private void CreateItems()
    {
        Dictionary <int, DRelics> dict = ReadCfgRelics.Dict;

        Dictionary <int, DRelics> .Enumerator em = dict.GetEnumerator();
        int i = 0;

        while (em.MoveNext())
        {
            GameObject go = NGUITools.AddChild(cardTrans.gameObject, cardTemp);
            DRelics    db = em.Current.Value;
            go.name = i.ToString();
            go.SetActive(true);

            RelicsCard tab = new RelicsCard();
            tab.btn         = go;
            tab.trans       = go.transform;
            tab.name        = go.transform.Find("Name").GetComponent <UILabel>();
            tab.progressBar = go.transform.Find("ProgressBar").GetComponent <UISlider>();
            tab.progress    = go.transform.Find("ProgressBar/Num").GetComponent <UILabel>();
            tab.icon        = go.transform.Find("Texture").GetComponent <UITexture>();
            tab.id          = em.Current.Key;

            tab.name.text         = db.Name;
            tab.progressBar.value = 0;
            tab.progress.text     = "0%";
            GTItemHelper.ShowTexture(tab.icon, db.Icon);

            mMoveList.Add(i);
            mCards.Add(tab);
            i++;
        }
        em.Dispose();
    }
Ejemplo n.º 2
0
 private void ShowDepthAndPosition()
 {
     for (int i = 0; i < mCards.Count; i++)
     {
         RelicsCard card  = mCards[i];
         int        index = mMoveList[i];
         RelicsMove move  = mMoves[index];
         card.trans.localPosition = move.pos;
         card.trans.localScale    = move.scale;
         SortDepth(move.depth, card.trans);
     }
 }