예제 #1
0
    /// <summary>
    /// 创建未召唤炮弹兵
    /// </summary>
    private void CreateNoExistHero()
    {
        int       count    = 0;
        PdbbbItem pbbItem  = null;
        bool      bHaveNot = false;

        for (int i = 0; i < m_allNoExistSoldierInfo.Count; i++)
        {
            SoldierInfo info = m_allNoExistSoldierInfo[i];
            if (m_iSelectLocation != -1)
            {
                if (m_iSelectLocation != info.m_loaction)
                {
                    continue;
                }
            }
            if (bHaveNot == false)
            {
                bHaveNot = true;
                CreateBanner();
            }
            if (count % 4 == 0)
            {
                pbbItem = null;
                GameObject go = NDLoad.LoadWndItem("PdbbbItem", MyHead.Parent.transform);
                pbbItem = go.GetComponent <PdbbbItem>();
                if (pbbItem != null)
                {
                    pbbItem.MyHead.Table.pivot = UITablePivot.Pivot.Left;
                }
            }
            count++;
            if (pbbItem != null && pbbItem.MyHead.Table != null)
            {
                GameObject go = NDLoad.LoadWndItem("NOExistHeroItem", pbbItem.MyHead.Table.transform);
                if (go != null)
                {
                    NOExistHeroItem item = go.GetComponent <NOExistHeroItem>();
                    if (item != null)
                    {
                        item.SetData(info, false);
                        m_NoExistSoldier.Add(item);
                    }
                }
                pbbItem.MyHead.Table.Reposition();
            }
        }
    }
예제 #2
0
    /// <summary>
    ///  创建 可以召唤但未召唤的炮弹兵
    /// </summary>
    private void CreateCanExistHero()
    {
        PdbbbItem pbbItem = null;
        int       count   = 0;

        for (int i = 0; i < m_allCanExistSoldierInfo.Count; i++)
        {
            SoldierInfo info = m_allCanExistSoldierInfo[i];
            if (m_iSelectLocation != -1)
            {
                if (m_iSelectLocation != info.m_loaction)
                {
                    continue;
                }
            }
            m_iCreatCount++;

            if (count % 4 == 0)
            {
                pbbItem = null;
                GameObject go = NDLoad.LoadWndItem("PdbbbItem", MyHead.Parent.transform);
                pbbItem = go.GetComponent <PdbbbItem>();
            }
            count++;
            if (pbbItem != null && pbbItem.MyHead.Table != null)
            {
                GameObject go = NDLoad.LoadWndItem("NOExistHeroItem", pbbItem.MyHead.Table.transform);
                if (go != null)
                {
                    NOExistHeroItem item = go.GetComponent <NOExistHeroItem>();
                    if (item != null)
                    {
                        item.SetData(info, true);

                        m_CanExistSoldier.Add(item);

                        if (m_tCanSummon == null)
                        {
                            m_tCanSummon      = item;
                            item.bGuideSelect = true;
                        }
                    }
                }
                pbbItem.MyHead.Table.Reposition();
            }
        }
    }