Ejemplo n.º 1
0
 public void SetBoxingList(Hashtable list)
 {
     while (boxTable.transform.childCount > 0)
     {
         DestroyImmediate(boxTable.transform.GetChild(0).gameObject);
     }
     if (list != null)
     {
         boxViewTable = new Hashtable();
         System.Collections.IDictionaryEnumerator enumerator = UserManager.Instance.RoleTable.GetEnumerator();
         while (enumerator.MoveNext())
         {
             //设置格子 roleTable
             BoxingViewData r = list[enumerator.Key] as BoxingViewData;
             if (r != null)
             {
                 GameObject obj = Instantiate(boxPrefabe);
                 obj.SetActive(true);
                 BoxingView pop = obj.GetComponent <BoxingView>();
                 pop.InitData(r, true);
                 obj.name                 = r.sort.ToString();
                 pop.transform.parent     = boxTable.transform;
                 pop.transform.position   = Vector3.zero;
                 pop.transform.localScale = Vector3.one;
                 if (!boxViewTable.Contains(r.data.csv_id))
                 {
                     boxViewTable.Add(r.data.csv_id, pop);
                 }
             }
         }
         boxScrollView.ResetPosition();
         boxTable.Reposition();
         boxTable.repositionNow = true;
     }
 }
Ejemplo n.º 2
0
    public void SetBoxingInfo(BoxingViewData data, List <string> strs)
    {
        ItemViewData item = new ItemViewData();

        item.curCount = data.data.levelData.item_num;
        item.data     = GameShared.Instance.GetItemData(data.data.levelData.item_id);
        Debug.Log("id" + data.data.csv_id + "fra" + data.fra_value);
        if (item != null)
        {
            itemIcon.InitData(item, false);
            itemName.text    = item.data.name;
            itemProcess.text = data.frag_num + "/" + data.data.levelData.item_num;
            fraSilder.value  = data.fra_value;
        }
        else
        {
            itemName.text    = "";
            itemProcess.text = "";
            fraSilder.value  = 0;
        }

        //upLevelBtn.isEnabled = data.canUpLevel;

        if (strs != null && strs.Count > 0)
        {
            for (int i = 0; i < strs.Count; i++)
            {
                if (i < attrs.Length)
                {
                    attrs[i].text = strs[i];
                }
            }
        }
        desc.text  = data.data.levelData.skill_desc;
        name.text  = data.data.name;
        level.text = data.data.levelData.skill_level.ToString();
        boxingIcon.InitData(data, false);
    }