Example #1
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);
        }
    }
Example #2
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;
            }
        }
    }
Example #3
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);
        }
    }
Example #4
0
    void RefreshChild()
    {
        List <Transform> transList = childMgrComponent.GetUsingTransList();

        Transform itemTrans;

        for (int i = 0; i < transList.Count; i++)
        {
            itemTrans = transList[i];
            RoleInstance role = currentRoleList[i];
            if (role == null)
            {
                continue;
            }
            Image icon    = itemTrans.Find("Mask/MainIcon").GetComponent <Image>();
            Text  qingong = itemTrans.Find("Qingong").GetComponent <Text>();
            Jyx2ResourceHelper.GetRoleHeadSprite(role, icon);
            qingong.text = string.Format($"轻功:{role.Qinggong}");

            Vector3 scale = i == 0 ? new Vector3(1.2f, 1.2f, 1.0f):Vector3.one;
            itemTrans.localScale = scale;
            SetItemPos(itemTrans, i);
        }
    }