private void SetStateHeader(ByteArrayReader reader) { IsSensor = reader.ReadBool(); IsStatic = reader.ReadBool(); ColorMask = reader.ReadColor(); TimeAlive = reader.ReadTimeSpan(); Size = reader.ReadVector(); Position = reader.ReadVector(); LinearVelocity = reader.ReadVector(); Rotation = reader.ReadFloat(); AngularVelocity = reader.ReadFloat(); Restitution = reader.ReadFloat(); Health = reader.ReadFloat(); SetTypeStateHeader(reader); }
public void SetFullState(ByteArrayReader reader) { var isNull = reader.ReadBool(); if (isNull) { _isNullWeapon = true; return; } else { _isNullWeapon = false; } TargetingType = (WeaponTargetingType)reader.ReadByte(); MaxDistance = reader.ReadFloat(); ProjectileType = ResolveTypeFromString(reader.ReadString()); ProjectileVelocity = reader.ReadHalfVector(); ProjectileOffset = reader.ReadHalfVector(); ProjectileRotation = reader.ReadHalf(); ProjectileRotationVelocity = reader.ReadHalf(); MaxActiveProjectileCount = reader.ReadUShort(); FireRotationIsRelativeToTankRotation = reader.ReadBool(); FireRotationIsRelativeToTankLookDirection = reader.ReadBool(); AddedRotation = reader.ReadHalf(); TransformPositionAndVelocityByRotation = reader.ReadBool(); WeaponRechargeTime = reader.ReadTimeSpan(); WeaponName = reader.ReadString(); TimeRecharged = reader.ReadTimeSpan(); _projectileArray = reader.ReadBytes(); }
protected override void ReceiveStateDataInternal(ByteArrayReader reader) { //state is the rotation ComponentGroups["turret"].Rotation = reader.ReadFloat(); }