Exemple #1
0
    /// <summary>
    /// 销毁整个对象。
    /// </summary>
    public void DestroyShipBuild()
    {
        PutERR Err = PutERR.ERR_NORMAL;

        if (PutCanvasM.CheckCanRemove(m_Core, ref Err) == false)
        {
            if (Err == PutERR.ERR_NOLink)
            {
                NGUIUtil.ShowTipWndByKey("88800009", 1.0f);
            }
            else if (Err == PutERR.ERR_HaveChild)
            {
                NGUIUtil.ShowTipWndByKey("88800010", 1.0f);
            }
            else
            {
                NGUIUtil.ShowTipWndByKey("88800011", 1.0f);
            }
            return;
        }
        if (m_Core.m_type == ShipBuildType.BuildStair)
        {
            //导致楼梯不删除的原因
            BuildProperty building = GetComponent <BuildProperty>();
            if (building != null)
            {
                GameObject skin = building.m_goAllBodySkin[0];
                if (skin != null)
                {
                    GameObjectActionExcute    gae  = skin.AddComponent <GameObjectActionExcute>();
                    GameObjectActionColorFade fade = new GameObjectActionColorFade(false, 1f);
                    fade.m_complete = DeleteStair;//删除楼梯表现回调
                    gae.AddAction(fade);
                }
            }
        }
        if (m_Building != null)
        {
            if (m_Core.Data.IsGoldBuild())
            {
                NGUIUtil.ShowTipWndByKey("88800012", 1.0f);
                return;
            }
        }
        MoveWithRoom(MyCore());
        TouchMoveManager.DeleteShipBuild(m_Core);
        CangKuWnd wnd = WndManager.GetDialog <CangKuWnd>();

        PutCanvasM.RemoveBuildRoom(m_Core);
        CreateStair(m_Core);
        GenerateDeck();
        TouchMoveManager.DoTransgatePoint();
        if (m_tTarget != null)
        {
            if (m_Core.m_type != ShipBuildType.BuildStair)
            {
                FlyToCangKuDelete(m_tTarget.gameObject, false);
                if (wnd)
                {
                    wnd.RefreshTrapUI();
                }
            }
        }
        //Destroy(GoClickBuildBtns);
    }
Exemple #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);
            }
        }
    }