Ejemplo n.º 1
0
    void RefreshView()
    {
        int childCount = currentRoleList != null ? currentRoleList.Count : 0;

        childMgrComponent.RefreshChildCount(childCount);
        if (childCount <= 0)
        {
            return;
        }
        RefreshChild();
    }
Ejemplo n.º 2
0
    //显示血条
    void ShowHUDSlider()
    {
        List <RoleInstance> roles = BattleManager.Instance.GetModel().AliveRoles;

        childMgr.RefreshChildCount(roles.Count);
        List <Transform> childTrans = childMgr.GetUsingTransList();

        for (int i = 0; i < childTrans.Count; i++)
        {
            HUDItem      item = GameUtil.GetOrAddComponent <HUDItem>(childTrans[i]);
            RoleInstance role = roles[i];
            if (role == null)
            {
                continue;
            }
            item.BindRole(role);
        }
    }
Ejemplo n.º 3
0
    void RefreshChild()
    {
        childMgr.RefreshChildCount(curShopData.ShopItems.Count);
        List <Transform> childList = childMgr.GetUsingTransList();

        for (int i = 0; i < childList.Count; i++)
        {
            Transform    trans      = childList[i];
            Jyx2ShopItem data       = curShopData.ShopItems[i];
            ShopUIItem   uiItem     = trans.GetComponent <ShopUIItem>();
            int          currentNum = GetHasBuyNum(data.Id);
            uiItem.Refresh(data, i, currentNum);
            uiItem.SetSelect(curSelectIndex == i);
            if (curSelectIndex == i)
            {
                curSelectItem = uiItem;
            }
        }
    }
Ejemplo n.º 4
0
    void RefreshSkill()
    {
        m_curItemList.Clear();
        var zhaoshis = m_currentRole.GetZhaoshis(true).ToList();

        childMgr.RefreshChildCount(zhaoshis.Count);
        List <Transform> childTransList = childMgr.GetUsingTransList();

        for (int i = 0; i < zhaoshis.Count; i++)
        {
            SkillUIItem item = GameUtil.GetOrAddComponent <SkillUIItem>(childTransList[i]);
            item.RefreshSkill(zhaoshis[i]);
            item.SetSelect(m_selectItem == item);

            Button btn = item.GetComponent <Button>();
            BindListener(btn, () =>
            {
                OnItemClick(item);
            });
            m_curItemList.Add(item);
        }
    }