コード例 #1
0
ファイル: PdbbbWnd.cs プロジェクト: 741645596/batgame
    /// <summary>
    /// 创建已召唤炮弹兵
    /// </summary>
    private void CreateExistHero()
    {
        int       count    = 0;
        PdbbbItem pdbbItem = null;

        for (int i = 0; i < m_allExistSoldier.Count; i++)
        {
            SoldierInfo info = m_allExistSoldier[i];
            if (m_iSelectLocation != -1)
            {
                if (m_iSelectLocation != info.m_loaction)
                {
                    continue;
                }
            }
            if (info == null)
            {
                continue;
            }
            m_iCreatCount++;
            if (count % 4 == 0)
            {
                pdbbItem = null;
                GameObject go = NDLoad.LoadWndItem("PdbbbItem", MyHead.Parent.transform);
                pdbbItem = go.GetComponent <PdbbbItem>();
                if (pdbbItem != null)
                {
                    pdbbItem.MyHead.Table.pivot = UITablePivot.Pivot.Left;
                }
            }
            count++;
            if (pdbbItem != null && pdbbItem.MyHead.Table != null)
            {
                GameObject go = NDLoad.LoadWndItem("ExistHeroItem", pdbbItem.MyHead.Table.transform);
                if (go != null)
                {
                    ExistHeroItem item = go.GetComponent <ExistHeroItem>();
                    if (item != null)
                    {
                        item.SetData(info);
                        m_ExistSoldier.Add(item);
                        if (info.CheckSoldierJinJie() && m_CanJinJieitem == null)
                        {
                            m_CanJinJieitem   = item;
                            item.BGuideSelect = true;
                        }
                        if (info.CheckHaveSkillUp() && m_tCanSkillUp == null)
                        {
                            m_tCanSkillUp     = item;
                            item.BGuideSelect = true;
                        }
                    }
                }
                pdbbItem.MyHead.Table.Reposition();
            }
        }
    }
コード例 #2
0
ファイル: PdbbbWnd.cs プロジェクト: 741645596/batgame
 private void CreateEmpty(Transform t)
 {
     if (t != null)
     {
         GameObject go = NDLoad.LoadWndItem("ExistHeroItem", t);
         if (go != null)
         {
             ExistHeroItem item = go.GetComponent <ExistHeroItem>();
             if (item != null)
             {
                 item.SetData(null);
                 m_ExistSoldier.Add(item);
             }
         }
     }
 }