Exemplo n.º 1
0
    // 添加一个选择的英雄
    public bool AddSelectHero(int index, ObjectCard objHero, int lithCount)
    {
        GameObject     cell   = Instantiate(Resources.Load("UI/Prefabs/UI_Home/SelectHeroInfo")) as GameObject;
        SelectHeroList select = cell.AddComponent <SelectHeroList>();

        select.index   = index;
        select.tableId = objHero.GetHeroData().TableID;
        select.Initialize(objHero);
        cell.transform.parent     = _selectHeroItem.transform;
        cell.transform.localScale = new UnityEngine.Vector3(1, 1, 1);
        _selectHeroList.Add(select);
        UpdateSelectItem();

        _gainCount += lithCount;
        UpdateShow(_selectHeroList.Count);

        for (int i = 0; i < _heroList.Count; ++i)
        {
            if (_heroList[i].card == objHero)
            {
                _heroList[i].isSelect = true;
                break;
            }
        }

        // 更新灰图显示
        if (_selectHeroList.Count == 12)
        {
            isAdd = true;
        }
        _curHeroLayout.UpdateCell();
        return(true);
    }
Exemplo n.º 2
0
    //找到对应的列表并刷新
    public void RefreshItemInfo()
    {
        if (IsReceive)
        {
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("mail_content22"), this.gameObject.transform);
            IsReceive = false;
        }

        m_MailBannerLayout.UpdateCell();
    }
Exemplo n.º 3
0
    // 点击英雄图标 Icon
    public void OnClickItemIcon(ObjectCard card)
    {
        if (m_CurCard == card)
        {
            return;
        }
        m_CurCard = card;

        // 更新英雄列表
        m_HeroLayout.UpdateCell();

        Show3DModel(m_CurCard);

        // 更新英雄信息
        UpdateHeroInfo();

        // 更新资质信息
        UpdateQualification();

        // 更新下面属性面板
        UpdateHeroAttr();

        // 更新右边属性面板
        if (m_CurAttrPanel != null)
        {
            m_CurAttrPanel.ShowHeroInfo(m_CurCard);
        }
    }
Exemplo n.º 4
0
    private void OnUpdateShow()
    {
        m_LoopLayout.UpdateCell();
        //更新列表
        // SelectItem(curType);
        List <RectTransform> cellList = m_LoopLayout.cellList;

        for (int i = 0; i < cellList.Count; ++i)
        {
            UI_ItemsButtonMassage items = cellList[i].GetComponent <UI_ItemsButtonMassage>();
            if (items.index == m_SelectIndex)
            {
                ItemList(items.baseItem);
                //更新左边详细信息
                UI_ItemsMassage._instance.UpdateShow(items.baseItem);
                //更新item信息
                items.UpdateShow(items.baseItem);
                break;
            }
            else
            {
                //uib.transform.FindChild("Parent/Border").gameObject.SetActive(false);
                items.SetSelectState(false);
            }
        }
    }
Exemplo n.º 5
0
    // 添加一个选择的符文
    public bool AddSelectRune(int index, int tableID, int smelt, int money, X_GUID guid)
    {
        // 判断是否超出了范围
        if (_selectRuneList.Count >= 12)
        {
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("heromelt_bubble2"), selfTransform.transform.parent);
            return(false);
        }

        GameObject cell   = Instantiate(Resources.Load("UI/Prefabs/UI_Rune/UI_RuneIcon")) as GameObject;
        SelectRune select = cell.AddComponent <SelectRune>();

        select.index   = index;
        select.tableID = tableID;
        select.guid    = _curRuneList[index].item.GetItemGuid();
        select.ShowInfo();
        cell.transform.parent     = _selectRuneItem.transform;
        cell.transform.localScale = new UnityEngine.Vector3(1, 1, 1);
        _selectRuneList.Add(select);
        UpdateSelectItem();

        _gainExp  += smelt;
        _gainGold += money;
        UpdateShow(_selectRuneList.Count);

        for (int i = 0; i < _curRuneList.Count; ++i)
        {
            if (_curRuneList[i].item.GetItemGuid() == guid)
            {
                _curRuneList[i].isSelect = true;
                break;
            }
        }

        // 更新灰图显示
        if (_selectRuneList.Count == 12)
        {
            isAdd = true;
        }
        _runeListLayout.UpdateCell();
        return(true);
    }
Exemplo n.º 6
0
    // 更新所有神器的属性,可以有优化的空间
    public void UpdateArtiItem()
    {
        _artifactList.Clear();

        Dictionary <int, Artifact> _map = ObjectSelf.GetInstance().ArtifactContainerBag.GetArtifactMap();

        for (int i = 0; i <= _map.Count; i++)
        {
            if (_map.ContainsKey(i))
            {
                _artifactList.Add(_map[i]);
            }
        }

        _artifactLayout.UpdateCell();
    }
Exemplo n.º 7
0
    public void UpdateRuneShow()
    {
        m_LoopLayout.UpdateCell();
        //SelectRune(m_CurType);
        List <RectTransform> cellList = m_LoopLayout.cellList;

        for (int i = 0; i < cellList.Count; ++i)
        {
            UI_RuneButtonMassage item = cellList[i].GetComponent <UI_RuneButtonMassage>();
            if (item.index == m_SelectIndex)
            {
                UI_RuneMassage._instance.UpdateShow(m_SelectIndex, item.rune);
                break;
            }
        }
    }
 /// <summary>
 /// 点击后收到服务器的数据回调 是否显示红N提示
 /// </summary>
 public void RefreshItemRedPoint()
 {
     RefreshSingleItemData();
     m_BannerLayout.UpdateCell();
 }