Exemple #1
0
 public void SetTable(ref Hashtable list)
 {
     while (table.transform.childCount > 0)
     {
         DestroyImmediate(table.transform.GetChild(0).gameObject);
     }
     viewList = new Hashtable();
     //System.Collections.IDictionaryEnumerator enumerator = list.GetEnumerator();
     //while (enumerator.MoveNext())
     //{
     foreach (RoleData r in UserManager.Instance.RoleTable.Values)
     {
         //RoleData r = vv as RoleData;//UserManager.Instance.RoleTable[enumerator.Key] as RoleData;
         GameObject obj = Instantiate(rolePrefabe);
         obj.SetActive(true);
         HeadRole pop = obj.GetComponent <HeadRole>();
         obj.name = r.sort.ToString();
         pop.InitData(r);
         pop.transform.parent     = table.transform;
         pop.transform.localScale = Vector3.one;
         viewList.Add(r.sort, pop);
     }
     table.Reposition();
     scroll.ResetPosition();
     table.repositionNow = true;
 }
Exemple #2
0
 public void SetRoleList(ref List <RoleData> list)
 {
     while (roleTable.transform.childCount > 0)
     {
         DestroyImmediate(roleTable.transform.GetChild(0).gameObject);
     }
     if (list != null)
     {
         roleViewTable = new Hashtable();
         for (int i = 0; i < list.Count; i++)
         {
             RoleData   r   = list[i] as RoleData;
             GameObject obj = Instantiate(rolePrefabe);
             obj.SetActive(true);
             HeadRole pop = obj.GetComponent <HeadRole>();
             pop.InitData(r, true);
             obj.name                 = r.sort.ToString();
             pop.transform.parent     = roleTable.transform;
             pop.transform.position   = Vector3.zero;
             pop.transform.localScale = Vector3.one;
             roleViewTable.Add(r.csv_id, pop);
         }
         roleTable.Reposition();
         roleScrollView.ResetPosition();
         roleScrollView.Scroll(0);
         roleTable.repositionNow = true;
     }
 }
Exemple #3
0
 public void RoleBattle(HeadRole v)
 {
     C2sSprotoType.role_battle.request obj = new C2sSprotoType.role_battle.request();
     obj.csv_id = v.data.csv_id;
     pop.BattleBtn.isEnabled = false;
     NetworkManager.Instance.RoleBattle(obj);
 }
Exemple #4
0
    public void WakeUp(HeadRole role)
    {
        int          id = pop.curView.data.starData.g_csv_id + 1;
        RoleStarData r  = GameShared.Instance.GetRoleStarById(id);

        if (!role.data.is_possessed)
        {
            r = GameShared.Instance.GetRoleStarById(pop.curView.data.starData.g_csv_id);
        }

        if (pop.curView.data.wakeLevel >= Def.WakeLevelMax)
        {
            ToastManager.Instance.Show("达到最大等级");
        }
        else if (pop.curView.data.frgNum < r.us_prop_num)
        {
            ToastManager.Instance.Show("碎片不够");
        }
        else if (pop.curView.data.is_possessed)
        {
            C2sSprotoType.role_upgrade_star.request obj = new C2sSprotoType.role_upgrade_star.request();
            obj.role_csv_id         = pop.curView.data.csv_id;
            pop.UpWakeBtn.isEnabled = false;
            NetworkManager.Instance.RoleWake(obj);
        }
        else
        {
            C2sSprotoType.role_recruit.request obj = new C2sSprotoType.role_recruit.request();
            obj.csv_id = pop.curView.data.csv_id;
            pop.UpWakeBtn.isEnabled = false;
            NetworkManager.Instance.RoleRecruit(obj);
        }
    }
Exemple #5
0
 //选中
 public void SetRoleFocus(HeadRole r)
 {
     if (pop != null && pop.curRoleView != r)
     {
         pop.curRoleView.SetFous(false);
         pop.curRoleView = r;
         r.SetFous(true);
         SetBoxingList();
         SetEquipBoxingList(ref r.data);
         //CheckBtn();
         Debug.Log(r.data.sort + "/" + r.data.csv_id);
     }
 }
Exemple #6
0
 public void RoleSelect(HeadRole role)
 {
     //LuaFunction f = l.GetFunction("RoleSelect");
     //object[] obj = f.Call(role);
     if (pop != null)
     {
         pop.GetCurView().SetFous(false);
         pop.SetCurView(role);
         SetRoleInfo(ref role.data);
         CheckBtn();
         Debug.Log(role.data.sort + "/" + role.data.csv_id);
     }
 }
Exemple #7
0
 public void SetCurView(HeadRole role)
 {
     curView = role;
     role.SetFous(true);
 }
Exemple #8
0
 public void RoleSelectClick(HeadRole h)
 {
     BoxingMgr.Instance.SetRoleFocus(h);
 }