public void Deserialize(ref DataStreamReader reader) { skillId = reader.ReadShort(); skill2Id = reader.ReadShort(); skill3Id = reader.ReadShort(); skill4Id = reader.ReadShort(); characterId = (uint)reader.ReadInt(); skinId = (uint)reader.ReadInt(); userId = reader.ReadString(); }
public void Deserialize(DataStreamReader reader, ref DataStreamReader.Context ctx) { TeamId = reader.ReadShort(ref ctx); CharacterType = reader.ReadInt(ref ctx); var nameLength = reader.ReadUShort(ref ctx); GameDebug.Assert(nameLength <= NativeString64.MaxLength); PlayerName.LengthInBytes = nameLength; unsafe { fixed(byte *b = &PlayerName.buffer.byte0000) { reader.ReadBytes(ref ctx, b, PlayerName.LengthInBytes); } } }
public void Deserialize(ref DataStreamReader reader) { intValue = reader.ReadInt(); shortValue = reader.ReadShort(); floatValue = reader.ReadFloat(); }
public unsafe void Deserialize(DataStreamReader reader, ref DataStreamReader.Context ctx) { ownerPlayerId = reader.ReadInt(ref ctx); actorType = reader.ReadShort(ref ctx); actorId = reader.ReadInt(ref ctx); dataMask = reader.ReadUShort(ref ctx); if ((dataMask & byteValueA) > 0) { datas.byteValueA = reader.ReadByte(ref ctx); } if ((dataMask & byteValueB) > 0) { datas.byteValueB = reader.ReadByte(ref ctx); } if ((dataMask & halfValueA) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.halfValueA), sizeof(half)); } if ((dataMask & halfValueB) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.halfValueB), sizeof(half)); } if ((dataMask & intValueA) > 0) { datas.intValueA = reader.ReadInt(ref ctx); } if ((dataMask & intValueB) > 0) { datas.intValueB = reader.ReadInt(ref ctx); } //if ((dataMask & lifetime) > 0) // reader.ReadBytes(ref ctx, (byte*)UnsafeUtility.AddressOf(ref datas.halfValueA), sizeof(half)); //if ((dataMask & hp) > 0) // reader.ReadBytes(ref ctx, (byte*)UnsafeUtility.AddressOf(ref datas.hp), sizeof(half)); //if ((dataMask & power) > 0) // reader.ReadBytes(ref ctx, (byte*)UnsafeUtility.AddressOf(ref datas.power), sizeof(half)); #if ACTOR_2D_SYNC if ((dataMask & position) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.position2d), sizeof(half2)); } if ((dataMask & rotation) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.rotation2d), sizeof(half)); } if ((dataMask & linearVelicity) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.linearVelicity2d), sizeof(half2)); } if ((dataMask & angularVelicity) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.angularVelicity2d), sizeof(half)); } #else if ((dataMask & position) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.position), sizeof(half3)); } if ((dataMask & rotation) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas._rotation), sizeof(half4)); } if ((dataMask & linearVelicity) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.linearVelicity), sizeof(half3)); } if ((dataMask & angularVelicity) > 0) { reader.ReadBytes(ref ctx, (byte *)UnsafeUtility.AddressOf(ref datas.angularVelicity), sizeof(half3)); } #endif }