Ejemplo n.º 1
0
    private void RefreshView(SelectRoomDTO room)
    {
        int team = room.GetTeam(GameData.user.ID);

        if (team == 1)
        {
            for (int i = 0; i < room.TeamOne.Length; i++)
            {
                left[i].Refresh(room.TeamOne[i]);
            }
            for (int i = 0; i < room.TeamTwo.Length; i++)
            {
                right[i].Refresh(room.TeamTwo[i]);
            }
        }
        else
        {
            for (int i = 0; i < room.TeamOne.Length; i++)
            {
                right[i].Refresh(room.TeamOne[i]);
            }
            for (int i = 0; i < room.TeamTwo.Length; i++)
            {
                left[i].Refresh(room.TeamTwo[i]);
            }
        }
        RefreshHeroList(room);
    }
Ejemplo n.º 2
0
    private void RefreshHeroList(SelectRoomDTO room)
    {
        int team = room.GetTeam(GameData.user.ID);
        List<int> selected = new List<int>();
        if (team == 1)
        {
            foreach (SelectModel item in room.TeamOne)
            {
                if (item.Hero != -1)
                {
                    selected.Add(item.Hero);
                }
            }
        }
        else
        {
            foreach (SelectModel item in room.TeamTwo)
            {
                if (item.Hero != -1)
                {
                    selected.Add(item.Hero);
                }
            }
        }

        //将已选的英雄从选择菜单设置状态改为不可选状态
        foreach (int item in gridMap.Keys)
        {
            if (selected.Contains(item) || !ready.interactable)
            {
                gridMap[item].Deactive();
            }
            else
            {
                gridMap[item].Active();
            }
        }
    }