示例#1
0
    public static void PutDownNewBuild()
    {
        TouchMove curTouchMove = TouchMoveManager.GetCurTouchMove();

        if (null != curTouchMove)
        {
            if (curTouchMove.MyCore().IsNewCreate)
            {
                bool canput = curTouchMove.MoveBuildUp();
                if (canput == false)
                {
                    curTouchMove.DestroyShipBuild();
                }
            }
        }
    }
示例#2
0
    void OnMouseUp()
    {
        if (!m_bMouseDown || PutCanvasM.CanOperate == false)
        {
            return;
        }
        m_bMouseDown = false;
        bool bCancelSel = false;
//        MainCameraM.s_Instance.EnableDrag(true);
        TouchMove selNewTouchMov = null;

        if (TouchMove.g_bSetParaing == true)
        {
            SetPara();
            return;
        }
        if (m_bTouchMoveChange)
        {
            if (m_roomGridTouchDown != null)
            {
                bCancelSel     = true;
                selNewTouchMov = PutCanvasM.GetTouchMoveByRoomGrid(m_roomGridTouchDown, m_curClickType);
                if (null == selNewTouchMov)
                {
                    CanvasCore buildRoomCoreTouchDown = m_roomGridTouchDown.GetBuildRoom();
                    selNewTouchMov = PutCanvasM.GetTouchMoveByCore(buildRoomCoreTouchDown);
                }
                if (selNewTouchMov)
                {
                    CanvasCore selCanvasCore = selNewTouchMov.MyCore();
                    bCancelSel = false;
                    TouchMove selOldeTouchMove = TouchMoveManager.GetCurTouchMove();
                    selNewTouchMov.PlayEditSelectAnimation();//点选时播放房间内陷阱动画
                    TouchMoveManager.SetCurTouchMove(selNewTouchMov);
                    selNewTouchMov.MoveWithRoom(selCanvasCore);
                }
                if (bCancelSel)
                {
                    TouchMoveManager.SetCurTouchMove(null);
                }
            }
        }
        else
        {
            selNewTouchMov = TouchMoveManager.GetCurTouchMove();
        }
        if (selNewTouchMov)
        {
            if (selNewTouchMov.MoveBuildUp())
            {
                //TouchMoveManager.ShowCanvas(false);
                PutCanvasM.ShowRoomGridUI(true);
            }
            else
            {
                PutCanvasM.ShowRoomGridUI(true);
            }
        }
        else
        {
            TouchMoveManager.SetCurTouchMove(null);
            //TouchMoveManager.ShowCanvas(false);
            PutCanvasM.ShowRoomGridUI(true);
        }
    }