//WSAD移动 public void RequireMove(NFGUID objectID, int nType, UnityEngine.Vector3 vPos, UnityEngine.Vector3 vTar) { NFMsg.ReqAckPlayerMove xData = new NFMsg.ReqAckPlayerMove(); xData.mover = mHelpModule.NFToPB(objectID); xData.moveType = nType; xData.moveType = 0; xData.speed = 4f; xData.time = 0; NFMsg.Vector3 xNowPos = new NFMsg.Vector3(); xNowPos.x = vPos.x; xNowPos.y = vPos.y; xNowPos.z = vPos.z; xData.source_pos.Add(xNowPos); NFMsg.Vector3 xTargetPos = new NFMsg.Vector3(); xTargetPos.x = vTar.x; xTargetPos.y = vTar.y; xTargetPos.z = vTar.z; xData.target_pos.Add(xTargetPos); mxBody.SetLength(0); xData.WriteTo(mxBody); SendMsg(NFMsg.EGameMsgID.EGMI_REQ_MOVE, mxBody); //为了表现,客户端先走,后续同步 }
public void SendSyncMessage() { syncMessageCount++; NFMsg.Vector3 position = new NFMsg.Vector3(); position.X = mxHeroMotor.GetMovePos().x; position.Y = mxHeroMotor.GetMovePos().y; position.Z = mxHeroMotor.GetMovePos().z; NFMsg.Vector3 direction = new NFMsg.Vector3(); direction.X = mxHeroMotor.GetMoveDrictor().x; direction.Y = mxHeroMotor.GetMoveDrictor().y; direction.Z = mxHeroMotor.GetMoveDrictor().z; NFMsg.ReqAckPlayerPosSync playerPosSync = new NFMsg.ReqAckPlayerPosSync(); playerPosSync.Mover = mHelpModule.NFToPB(mLoginModule.mRoleID); NFMsg.PosSyncUnit posSyncUnit = new NFMsg.PosSyncUnit(); posSyncUnit.Pos = position; posSyncUnit.Direction = direction; posSyncUnit.Status = (int)mAnimaStateMachine.CurState(); playerPosSync.SyncUnit.Add(posSyncUnit); mxNetModule.RequireSyncPosition(playerPosSync); }
static public NFMsg.Vector3 NFToPB(NFVector3 value) { NFMsg.Vector3 vector = new NFMsg.Vector3(); vector.x = value.X(); vector.y = value.Y(); vector.z = value.Z(); return(vector); }
public NFMsg.Vector3 NFToPB(NFVector3 value) { NFMsg.Vector3 vector = new NFMsg.Vector3(); vector.X = value.X(); vector.Y = value.Y(); vector.Z = value.Z(); return(vector); }
static public NFVector3 PBToNF(NFMsg.Vector3 value) { NFVector3 vector = new NFVector3(); vector.SetX(value.x); vector.SetY(value.y); vector.SetZ(value.z); return(vector); }
public NFVector3 PBToNF(NFMsg.Vector3 xVector) { NFVector3 xData = new NFVector3(xVector.x, xVector.y, xVector.z); return(xData); }
public NFSDK.NFVector3 PBToNF(NFMsg.Vector3 xVector) { NFVector3 xData = new NFVector3(xVector.X, xVector.Y, xVector.Z); return(xData); }