Ejemplo n.º 1
0
    //设置装备技能
    public void SetEquipBoxingList(ref RoleData r)
    {
        for (int i = 0; i < pop.activeArr.Length; i++)
        {
            pop.activeArr[i].RestEquipEmpty(i + 1);
        }
        for (int i = 0; i < pop.passiveArr.Length; i++)
        {
            pop.passiveArr[i].RestEquipEmpty(i + 6);
        }

        if (r.boxingList != null && r.boxingList.Count > 0)
        {
            for (int i = 0; i < r.boxingList.Count; i++)
            {
                BoxingEquipData v   = r.boxingList[i];
                int             pos = r.boxingList[i].position;
                Debug.Log(v.viewdata.data.csv_id + "pos" + r.boxingList[i].position);
                if (pos <= 5)
                {
                    pop.activeArr[pos - 1].InitData(v, pos);
                }
                else
                {
                    pop.passiveArr[pos - 6].InitData(v, pos);
                }
            }
        }
    }
Ejemplo n.º 2
0
 public void RestEquipEmpty(int i)
 {
     equip            = new BoxingEquipData();
     equip.position   = i;
     data             = null;
     icon.spriteName  = "";
     kuang.spriteName = "";
     SetFous(false);
     this.name = "None";
 }
Ejemplo n.º 3
0
 public void InitData(BoxingEquipData e, int p, bool click = true)
 {
     equip   = e;
     data    = e.viewdata;
     isClick = click;
     SetFous(false);
     if (data.data != null && data.data.levelData != null)
     {
         SetUnlock();
         this.name = data.sort.ToString();
         type      = data.data.levelData.skill_type;
         SetBgQuality(data.data.levelData.quality);
         icon.spriteName = data.data.levelData.skill_icon.ToString();
         SetType(data.data.levelData.skill_type);
     }
     else
     {
         RestEmpty();
     }
 }
Ejemplo n.º 4
0
 public void InitBoxingListCallback(C2sSprotoType.kungfu.response resp)
 {
     //用户拳法表
     if (resp.k_list != null)
     {
         for (int i = 0; i < resp.k_list.Count; i++)
         {
             int id = (int)resp.k_list[i].csv_id;
             C2sSprotoType.kungfu_content c = resp.k_list[i];
             Debug.Log("id" + resp.k_list[i].csv_id + "num" + resp.k_list[i].k_sp_num + "level" + resp.k_list[i].k_level);
             if (UserManager.Instance.boxTable.Contains(id))
             {
                 BoxingViewData v = UserManager.Instance.boxTable[id] as BoxingViewData;
                 v.level    = (int)c.k_level;
                 v.frag_num = (int)c.k_sp_num;
                 v.type     = (int)c.k_type;
                 int levelid = (1000 * v.data.csv_id) + v.level;
                 v.data.levelData = GameShared.Instance.GetBoxingLevelById(levelid);
                 v.sort           = GetSort(v);
                 UserManager.Instance.boxTable[v.data.csv_id] = v;
             }
             else
             {
                 BoxingViewData v = new BoxingViewData();
                 v.level    = (int)c.k_level;
                 v.frag_num = (int)c.k_sp_num;
                 v.type     = (int)c.k_type;
                 v.data     = GameShared.Instance.GetBoxingById((int)c.csv_id);
                 int levelid = (1000 * v.data.csv_id) + v.level;
                 v.sort           = GetSort(v);
                 v.data.levelData = GameShared.Instance.GetBoxingLevelById(levelid);
                 UserManager.Instance.boxTable.Add(id, v);
             }
         }
     }
     //用户角色表
     if (resp.role_kid_list != null)
     {
         roleList = new List <RoleData>();
         for (int i = 0; i < resp.role_kid_list.Count; i++)
         {
             int id = (int)resp.role_kid_list[i].r_csv_id;
             C2sSprotoType.kungfu_role_list c = resp.role_kid_list[i];
             Debug.Log(c.r_csv_id);
             RoleData r = UserManager.Instance.GetRoleById((int)c.r_csv_id);
             if (r != null && resp.role_kid_list[i].pos_list != null)
             {
                 r.boxingList = new List <BoxingEquipData>();
                 for (int j = 0; j < c.pos_list.Count; j++)
                 {
                     int dd = (int)c.pos_list[j].k_csv_id / 1000;
                     Debug.Log("roleid" + resp.role_kid_list[i].r_csv_id + "boxid" + c.pos_list[j].k_csv_id + "pos" + c.pos_list[j].position);
                     BoxingViewData  b  = UserManager.Instance.GetBoxingById(dd);
                     BoxingEquipData eq = new BoxingEquipData();
                     eq.viewdata = b;
                     eq.position = (int)c.pos_list[j].position;
                     r.boxingList.Add(eq);
                 }
             }
             roleList.Add(r);
         }
     }
     if (pop != null && roleList != null)
     {
         RoleListCallBack(ref roleList);
         SetBoxingList();
         SetEquipBoxingList(ref pop.curRoleView.data);
     }
     else
     {
         Debug.Log("用户空");
     }
 }