public static void UnserializeInbound(CNetworkPlayer _cNetworkPlayer, CNetworkStream _cStream) { GameObject cPlayerActor = CGamePlayers.GetPlayerActor(_cNetworkPlayer.PlayerId); if (cPlayerActor != null) { CPlayerAirMotor cAirMotor = cPlayerActor.GetComponent <CPlayerAirMotor>(); while (_cStream.HasUnreadData) { ENetworkAction eNetworkAction = (ENetworkAction)_cStream.ReadByte(); switch (eNetworkAction) { case ENetworkAction.UpdateStates: cAirMotor.m_usMovementStates = _cStream.ReadUInt(); break; default: Debug.LogError(string.Format("Unknown network action ({0})", (int)eNetworkAction)); break; } } } }
void FixedUpdate() { if (CNetwork.IsServer) { CPlayerAirMotor airMotor = GetComponent <CPlayerAirMotor>(); if (!airMotor.IsActive) { ProcessMovement(); m_fRotationY.Set(transform.eulerAngles.y); } } }
void Update() { CPlayerAirMotor airMotor = GetComponent <CPlayerAirMotor>(); if (!airMotor.IsActive) { // Process grounded check on server and client UpdateGrounded(); // Process input only for client owned actors if (CGamePlayers.SelfActor == gameObject) { UpdateRotation(); UpdateInput(); } } }