//装饰物旋转 public static void SendManorDecorateRotate(CSManorDecorateRotate csManorDecorateRotate, Action <SCEmptyManorDecorateRotate> ResponseSCEmptyManorDecorateRotateCallBack, Action <ErrorInfo> errorCallBack) { if (StaticData.IsUsedLocalDataNotServer) { SCEmptyManorDecorateRotate scEmptyManorDecorateRotate = new SCEmptyManorDecorateRotate(); ResponseSCEmptyManorDecorateRotateCallBack(scEmptyManorDecorateRotate); } else { ProtocalManager.Instance().SendCSManorDecorateRotate(csManorDecorateRotate, ResponseSCEmptyManorDecorateRotateCallBack, errorCallBack, false); } }
//确认旋转 public async void OnButtonRotateOKClick(bool isAutoPlayCloseDecorate = true) { if (isAutoPlayCloseDecorate) { //关闭装饰物界面 UIComponent.GetComponentHaveExist <UIManorComponent>(UIType.UIManor).uiManorAnim.PlayAnimCloseDecorate(); } if (AfterRotateInfo.SoilId <= 0)//没有旋转过 { //关闭界面 goRebackAndRotate.SetActive(false); //关闭提示 TipsTileComponent._instance.CloseAll(); isRotatingDecorate = false; return; } if (AfterRotateInfo.isCanPlace) {//能放,提交服务器 CSManorDecorateRotate csManorDecorateRotate = new CSManorDecorateRotate() { SoilId = (int)AfterRotateInfo.SoilId, RotateIndex = AfterRotateInfo.idxDecorateRotate }; ManorProtocalHelper.SendManorDecorateRotate(csManorDecorateRotate, async(succ) => { if (isAutoPlayCloseDecorate) { //关闭界面 goRebackAndRotate.SetActive(false); isRotatingDecorate = false; } //关闭提示 TipsTileComponent._instance.CloseAll(); //排序 Root2dSceneManager._instance.UpdateSortLayer(true); }, async(error) => { //旋转成最开始的样子 await ResetToOldDecorate(isAutoPlayCloseDecorate); }); } else {//不能放,旋转成最开始的样子 await ResetToOldDecorate(isAutoPlayCloseDecorate); } }
public void SendCSManorDecorateRotate(CSManorDecorateRotate csmanordecoraterotate, Action <SCEmptyManorDecorateRotate> ResponseSCEmptyManorDecorateRotateCallBack, Action <ErrorInfo> errorCallBack, bool isShowDefaultTip = true) { OpCodeType opCodeType = ListOPRelation.GetOpCodeTypeByRequest <CSManorDecorateRotate> (); ProtoSendMethod.BusinessRequest <SCEmptyManorDecorateRotate>(csmanordecoraterotate, opCodeType, ResponseSCEmptyManorDecorateRotateCallBack, errorCallBack, isShowDefaultTip); }