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);
            }
        }
Beispiel #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);
        }