Class BinaryReaderExtensions
Extension methods that add typed read helpers to BinaryReader for common Unity value types.
Inherited Members
Namespace: Unity.SimulationPro.Foundation
Assembly: Unity.SimulationPro.Foundation.dll
Syntax
public static class BinaryReaderExtensions
Methods
ReadBounds(BinaryReader)
Declaration
public static Bounds ReadBounds(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Bounds | The deserialized Bounds. |
ReadColor(BinaryReader)
Declaration
public static Color ReadColor(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Color | The deserialized Color. |
ReadColor32(BinaryReader)
Declaration
public static Color32 ReadColor32(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Color32 | The deserialized Color32. |
ReadQuaternion(BinaryReader)
Reads a Quaternion from the stream (four consecutive float values: x, y, z, w).
Declaration
public static Quaternion ReadQuaternion(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Quaternion | The deserialized Quaternion. |
ReadVector2(BinaryReader)
Declaration
public static Vector2 ReadVector2(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Vector2 | The deserialized Vector2. |
ReadVector2Int(BinaryReader)
Reads a Vector2Int from the stream (two consecutive int values: x, y).
Declaration
public static Vector2Int ReadVector2Int(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Vector2Int | The deserialized Vector2Int. |
ReadVector3(BinaryReader)
Declaration
public static Vector3 ReadVector3(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Vector3 | The deserialized Vector3. |
ReadVector4(BinaryReader)
Declaration
public static Vector4 ReadVector4(this BinaryReader reader)
Parameters
| Type | Name | Description |
|---|---|---|
| BinaryReader | reader | The binary reader to read from. |
Returns
| Type | Description |
|---|---|
| Vector4 | The deserialized Vector4. |