Example #1
0
    public void BtnSelect_OnClickEventHandler(UIButton sender)
    {
        //NGUIUtil.DebugLog(string.Format("选取了 炮弹兵:"+Info.m_name));
        //SoldierInfoWnd wnd  =  WndManager.FindDialog<SoldierInfoWnd>();
        //if (wnd)
        //{
        //    if (m_info!=null)
        //    {
        //        wnd.SetData(m_info);
        //    }
        //}
        SoldierScrollWnd scrollWnd = WndManager.FindDialog <SoldierScrollWnd>();

        if (scrollWnd)
        {
            scrollWnd.DoSelectItem(transform);
        }
        else
        {
            SelectSoldierwnd selectWnd = WndManager.FindDialog <SelectSoldierwnd>();
            if (selectWnd)
            {
                selectWnd.SelectSoldier(m_info.ID);
            }
        }
    }
Example #2
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);
            }
        }
    }