Пример #1
0
 public void WriteToBuffer(SerializationBuffer buf, bool mustBeFullState)
 {
     buf.WriteFloat(MoveAxisForward);
     buf.WriteFloat(MoveAxisRight);
     buf.WriteQuaternion(CameraRotation);
     buf.WriteBool(JumpDown);
     buf.WriteBool(Fire);
 }
Пример #2
0
        public void Serialize(SerializationBuffer buf)
        {
            buf.SeekZero();
            buf.WriteInt((int)NetworkMessageID.SpawnCharacter);

            buf.WriteInt(CharacterId);
            buf.WriteInt(ForPlayerId);
            buf.WriteVector3(SpawnPosition);
            buf.WriteQuaternion(SpawnRotation);
        }
Пример #3
0
        public void Serialize(SerializationBuffer buf)
        {
            buf.SeekZero();
            buf.WriteInt((int)NetworkMessageID.LazerHit);

            buf.WriteInt(AtTick);
            buf.WriteInt(FiringPlayerId);
            buf.WriteQuaternion(FiringRotation);
            buf.WriteInt(HitCharacterId);
        }
        public void WriteToBuffer(SerializationBuffer buf, bool mustBeFullState)
        {
            int characterStatesCount = CharacterStates.Count;

            buf.WriteInt(characterStatesCount);
            for (int i = 0; i < characterStatesCount; i++)
            {
                buf.WriteInt(CharacterStates[i].DataId);

                buf.WriteVector3(CharacterStates[i].DataStruct.MotorState.Position);
                buf.WriteQuaternion(CharacterStates[i].DataStruct.MotorState.Rotation);
                buf.WriteVector3(CharacterStates[i].DataStruct.MotorState.BaseVelocity);

                buf.WriteBool(CharacterStates[i].DataStruct.IsStunned);
            }
        }