public override void WndStart() { base.WndStart(); if (MyHead.BtnYES) { MyHead.BtnYES.OnClickEventHandler += BtnYES_OnClickEventHandler; } if (MyHead.BtnNO) { MyHead.BtnNO.OnClickEventHandler += BtnNO_OnClickEventHandler; } PutCanvasM.ShowRoomGridUI(false); }
private void BtnReutrnBag_OnClickEventHandler(UIButton sender) { if (m_Core.m_type == ShipBuildType.BuildRoom) { SetBuildParaOver(); PutCanvasM.ShowRoomGridUI(false); DestroyShipBuild(); } else if (m_Core.m_type == ShipBuildType.Soldier) { DestroyShipBuild(); PutCanvasM.ShowRoomGridUI(false); } }
void BtnDeleteSoldier_OnClickEventHandler(UIButton sender) { List <CanvasCore> childrenCore = PutCanvasM.GetChildByCore(m_Core); if (childrenCore.Count == 0) { return; } foreach (var childCore in childrenCore) { TouchMove tm = PutCanvasM.GetTouchMoveByCore(childCore); if (childCore.m_type == ShipBuildType.Soldier) { tm.DestroyShipBuild(); } } PutCanvasM.ShowRoomGridUI(false); }
void SaveSuccecd() { TouchMoveManager.ShowCanvas(false); MainCameraM.s_Instance.ResetCameraDataByHaven(); MainCameraM.s_Instance.EnableOthOn(false); MainCameraM.s_Instance.SetCameraLimitParam(MainCameraM.s_reaLimitPyramidHavenView); MainCameraM.s_Instance.AutoMoveTo(MainCameraM.s_vHavenViewBoatviewCamPos, 0.3f); MainCameraM.s_Instance.EnableDrag(false); Life.Environment = LifeEnvironment.View; PutCanvasM.PutDownNewBuild(); TouchMoveManager.DoTransgatePoint(); m_IsSaving = true; if (MyHead.BtnReturn) { MyHead.BtnReturn.gameObject.SetActive(false); } if (MyHead.BtnNext) { MyHead.BtnNext.gameObject.SetActive(false); } CangKuWnd wnd = WndManager.FindDialog <CangKuWnd>(); if (wnd) { wnd.gameObject.SetActive(false); } PutCanvasM.CanOperate = false; PutCanvasM.ShowRoomGridUI(false); TouchMoveManager.SetCurTouchMove(null); MainCameraM.s_Instance.EnableDrag(false); ShipPlan P = ShipPlanDC.GetCurShipPlan(); P.CreateCanvans(); GenerateShip.GenerateShipsWithAni(); }
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); } }
void Update() { if (MainCameraM.s_Instance.CheckIsZooming() || MainCameraM.s_Instance.CheckCameraMove()) { PutCanvasM.ShowRoomGridUI(false); } if (PutCanvasM.CanOperate == false) { return; } if (Input.touchCount >= 2) { PutCanvasM.ShowRoomGridUI(false); m_bTouchMoveChange = true; m_roomGridTouchDown = null; } // MainCameraM.s_Instance.EnableDrag(true); if (m_bMouseDown) { if (!m_isDrag) { float click = mouseClickThreshold; click *= click; m_vtotalmouseDelta += m_vlastFirstTouch - GetTouchPos(0); m_vlastFirstTouch = GetTouchPos(0); m_mag = m_vtotalmouseDelta.sqrMagnitude; if (m_mag > click) { m_isDrag = true; } else { //没有发生移动地图 或 没有发生长按 要判定 if (!m_isDrag && !m_bLongTouch) { //长按判定 if (!m_isDrag && m_roomGridTouchDown != null) { if (Time.time - m_fMouseDownTime > 0.5f) { m_bLongTouch = true; } //没有发生移动地图,但有发生长按,则更换选中房间,并将m_bTouchMoveChange=false if (m_bLongTouch) { CanvasCore buildRoomCoreTouchDown = m_roomGridTouchDown.GetBuildRoom(); TouchMove selNewTouchMov = PutCanvasM.GetTouchMoveByCore(buildRoomCoreTouchDown); TouchMove selOldeTouchMove = TouchMoveManager.GetCurTouchMove(); if (selNewTouchMov != null && selNewTouchMov != selOldeTouchMove) { m_bTouchMoveChange = false; TouchMoveManager.SetCurTouchMove(selNewTouchMov); selNewTouchMov.OnMouseDown(); } } } } } } if (m_isDrag) { //按下是选中的是原选中房间,则直接移动该房间 //长按时会自动将最新选中房间,并将m_bTouchMoveChange设置为false if (!m_bTouchMoveChange) { MainCameraM.s_Instance.EnableDrag(false); TouchMove curTouchMove = TouchMoveManager.GetCurTouchMove(); if (null != curTouchMove) { PutCanvasM.ShowRoomGridUI(false); //TouchMoveManager.ShowCanvas(true); PutCanvasM.ShowRoomGridUI(false); curTouchMove.MoveBuild(); } } } } }
void BtnShow_OnClickEventHandler(UIButton sender) { PutCanvasM.PutDownNewBuild(); PutCanvasM.ShowRoomGridUI(false); ClickMenuBtn(); }
private void YesReAuth(UIButton sender) { TouchMoveManager.DeleteAll(); PutCanvasM.ShowRoomGridUI(false); }