public void Deserialize(SerializationBuffer buf) { CharacterId = buf.ReadInt(); ForPlayerId = buf.ReadInt(); SpawnPosition = buf.ReadVector3(); SpawnRotation = buf.ReadQuaternion(); }
public void Deserialize(SerializationBuffer buf) { AtTick = buf.ReadInt(); FiringPlayerId = buf.ReadInt(); FiringRotation = buf.ReadQuaternion(); HitCharacterId = buf.ReadInt(); }
public void ReadFromBuffer(SerializationBuffer buf) { int CharacterStatesCount = buf.ReadInt(); for (int i = 0; i < CharacterStatesCount; i++) { int characterId = buf.ReadInt(); Vector3 position = buf.ReadVector3(); Quaternion rotation = buf.ReadQuaternion(); Vector3 velocity = buf.ReadVector3(); bool isStunned = buf.ReadBool(); // Find CharacterState corresponding to this ID and apply the state for (int j = 0; j < CharacterStates.Count; j++) { if (CharacterStates[j].DataId == characterId) { IdentifiedData <MyCharacterState> tmpIdCharState = CharacterStates[j]; tmpIdCharState.DataStruct.MotorState.Position = position; tmpIdCharState.DataStruct.MotorState.Rotation = rotation; tmpIdCharState.DataStruct.MotorState.BaseVelocity = velocity; tmpIdCharState.DataStruct.IsStunned = isStunned; CharacterStates[j] = tmpIdCharState; break; } } } }
public void ReadFromBuffer(SerializationBuffer buf) { MoveAxisForward = buf.ReadFloat(); MoveAxisRight = buf.ReadFloat(); CameraRotation = buf.ReadQuaternion(); JumpDown = buf.ReadBool(); Fire = buf.ReadBool(); }