示例#1
0
    private void CreateList()
    {
        if (MyHead.ListParent == null)
        {
            NGUIUtil.DebugLog("ShipCanvasDialogWnd ListParent!!!");
            return;
        }

        //先删除
        foreach (CanvasItem item in m_lItems)
        {
            if (item != null)
            {
                GameObject.DestroyImmediate(item.gameObject);
            }
        }
        ;
        m_lItems.Clear();
        //重新添加。
        if (m_shipBuildType == ShipBuildType.BuildRoom)
        {
            foreach (var a in warehouseBuildList)
            {
                if (TouchMoveManager.CheckHaveExist(m_shipBuildType, a.ID) == false)
                {
                    AddBuild(a);
                }
            }
        }
        if (m_shipBuildType == ShipBuildType.Soldier)
        {
            foreach (var a in soldierList)
            {
                if (TouchMoveManager.CheckHaveExist(m_shipBuildType, a.ID) == false)
                {
                    AddSoldier(a);
                }
            }
        }
        NGUIUtil.RepositionTable(MyHead.ListParent);
    }
示例#2
0
 private void CreateList()
 {
     if (m_shipBuildType == ShipBuildType.BuildRoom)
     {
         foreach (var a in warehouseBuildList)
         {
             if (TouchMoveManager.CheckHaveExist(m_shipBuildType, a.ID) == false)
             {
                 AddBuild(a);
             }
         }
     }
     if (m_shipBuildType == ShipBuildType.Soldier)
     {
         foreach (var a in soldierList)
         {
             if (TouchMoveManager.CheckHaveExist(m_shipBuildType, a.ID) == false)
             {
                 AddSoldier(a);
             }
         }
     }
 }
示例#3
0
    public void BtnSelect_OnClickEventHandler()
    {
        if (m_iItemType == 3)
        {
            if (m_bSelect)
            {
                return;
            }
            m_bSelect = true;

            SoldierScrollWnd scrollWnd = WndManager.FindDialog <SoldierScrollWnd>();
            if (scrollWnd)
            {
                scrollWnd.DoSelectItem(transform);
            }
            else
            {
                SelectSoldierwnd selectWnd = WndManager.FindDialog <SelectSoldierwnd>();
                if (selectWnd)
                {
                    selectWnd.SelectSoldier(Soldier.ID);
                }
            }
            return;
        }

        if (m_iItemType != 0)
        {
            return;
        }

        int id = 0;

        if (m_ShipBuildType == ShipBuildType.BuildRoom)
        {
            id = m_WareHouse [0].ID;
        }
        else if (m_ShipBuildType == ShipBuildType.Soldier)
        {
            id = Soldier.ID;
        }
        if (TouchMoveManager.CheckHaveExist(m_ShipBuildType, id))
        {
            return;
        }
        CangKuWnd wnd = WndManager.FindDialog <CangKuWnd>();

        //PlaneClickGrid.HideCangKuUI();
        if (m_ShipBuildType == ShipBuildType.BuildRoom)
        {
            BattleEnvironmentM.CreateBuildingFromWarehouse(m_WareHouse [0]);
            m_WareHouse.RemoveAt(0);
            if (wnd)
            {
                wnd.RefreshTrapUI();
            }
        }
        else if (m_ShipBuildType == ShipBuildType.Soldier)
        {
            ShipPlan P = ShipPlanDC.GetCurShipPlan();
            if (P.CheckSoldierUpMaxCount() == true)
            {
                NGUIUtil.ShowTipWndByKey("88800014", 2.0f);
            }
            else
            {
                BattleEnvironmentM.CreateSoldierFromWarehouse(Soldier.ID);
                wnd.RefreshSoldierUI(CombatLoactionType.ALL);
            }
        }
    }