Ejemplo n.º 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);
    }