//获取自己庄园的信息 public static void GetSelfManorInfo(CSEmptyManorInfo csEmptyManorInfo, Action <SCManorData> ResponseSCManorDataCallBack) { if (StaticData.IsUsedLocalDataNotServer) { //测试 SCManorData scManorData = new SCManorData(); SCManorStruct scManorStruct = new SCManorStruct() { SoilId = 1001, SoilType = ManorScene.Tile, CropGoodId = 0, Yield = 0, TotalYield = 0, SoilStatus = 0, Xaxle = -8.4338960647583f, Yaxle = 12.0527410507202f, NextTime = 0, ParcelDivision = 1 }; scManorData.ManorInfo.Add(scManorStruct); ResponseSCManorDataCallBack(scManorData); } else { //这里处理默认的提示问题 ProtocalManager.Instance().SendCSEmptyManorInfo(csEmptyManorInfo, ResponseSCManorDataCallBack, (error) => { }, false); } }
/// <summary> /// /// </summary> /// <param name="friendId">-1 表示自己</param> public async UniTask EnterManor(long friendId) { if (friendId == -1) {//自己 StaticData.DataDot(Company.Cfg.DotEventId.OpenManor); StaticData.idPreEnterManor = -1; CSEmptyManorInfo csEmptyManorInfo = new CSEmptyManorInfo(); ManorProtocalHelper.GetSelfManorInfo(csEmptyManorInfo, async(scManorData) => { Root2dSceneManager._instance.isFriendManor = false; //设置头像信息 StaticData.SetPlayerIconInfo(); Root2dSceneManager._instance.UnlockAreaInfoSelf = scManorData.UnlockAreaInfo; // add_by_wsf mouseManorManager.playerUid = StaticData.Uid; // add_by_wsf end await GenerateExistPlants(scManorData.ManorInfo, false); SetRegionsUnLockInfoState(); //根据本地数据恢复相机参数 worldCameraComponent.SetWorldCameraParam(); //判定是不是有公棚 SetCameraToWorkShedRegion(); //是否触发Avg动画 if (LocalInfoData.localManorInfoData != null && LocalInfoData.localManorInfoData.isFirstAvgDialogFinish == false) { //打开对话框 var UIDialogGo = await UIComponent.CreateUIAsync(UIType.UIManorUnLockRegionDialog); UIDialogGo.GetComponent <UIManorUnLockRegionDialogComponent>().BeginFirstAVGDialog(); } }); } else {//好友 StaticData.DataDot(Company.Cfg.DotEventId.EnterFriendManor); //新手引导 if (friendId == 1 && StaticData.isOpenGuide && GuideCanvasComponent._instance != null && GuideCanvasComponent._instance.CurrExecuteGuideLittleStepDefine.Id == 10023) { CSEmptyManorGuidance csEmptyManorGuidance = new CSEmptyManorGuidance() { }; ManorProtocalHelper.LookFriendGuide(csEmptyManorGuidance, async(scManorData) => { Root2dSceneManager._instance.isFriendManor = true; //设置头像信息 StaticData.SetPlayerIconInfo(); Root2dSceneManager._instance.UnlockAreaInfoFriend = scManorData.UnlockAreaInfo; StaticData.GetUIWorldHandleComponent().IdFriend = friendId; mouseManorManager.playerUid = friendId; SetFriendGuideStealClass(scManorData.ManorInfo); await GenerateExistPlants(scManorData.ManorInfo, true); SetRegionsUnLockInfoState(); }); return; } CSQueryOther csQueryOther = new CSQueryOther() { OtherUid = friendId }; ManorProtocalHelper.LookFriendManorInfo(csQueryOther, async(scManorData) => { Root2dSceneManager._instance.isFriendManor = true; //设置头像信息 StaticData.SetPlayerIconInfo(); Root2dSceneManager._instance.UnlockAreaInfoFriend = scManorData.UnlockAreaInfo; StaticData.GetUIWorldHandleComponent().IdFriend = friendId; // add_by_wsf mouseManorManager.playerUid = friendId; // add_by_wsf end //设置是否能偷的状态 SetFriendManorListStealClass(scManorData); await GenerateExistPlants(scManorData.OtherManorInfo, true); SetRegionsUnLockInfoState(); }); } }
public void SendCSEmptyManorInfo(CSEmptyManorInfo csemptymanorinfo, Action <SCManorData> ResponseSCManorDataCallBack, Action <ErrorInfo> errorCallBack, bool isShowDefaultTip = true) { OpCodeType opCodeType = ListOPRelation.GetOpCodeTypeByRequest <CSEmptyManorInfo> (); ProtoSendMethod.BusinessRequest <SCManorData>(csemptymanorinfo, opCodeType, ResponseSCManorDataCallBack, errorCallBack, isShowDefaultTip); }