Photon Fusion 2.0.0

Static Public Member Functions | Static Public Attributes | List of all members
ReadWriteUtils Class Reference

Provides utility methods for reading and writing data. More...

Static Public Member Functions

static float ReadFloat (int *data)
 Reads a float value from the provided memory location.
 
static NetworkBehaviour ReadNetworkBehaviourRef (int *data, NetworkRunner runner, out bool isValid)
 Reads a NetworkBehaviour reference from the provided memory location. Null is considered valid (0,1).
 
static Quaternion ReadQuaternion (int *data)
 Reads a Quaternion value from the provided memory location.
 
static Vector2 ReadVector2 (int *data)
 Reads a Vector2 value from the provided memory location.
 
static Vector3 ReadVector3 (int *data)
 Reads a Vector3 value from the provided memory location.
 
static Vector4 ReadVector4 (int *data)
 Reads a Vector4 value from the provided memory location.
 
static void WriteEmptyNetworkBehaviourRef (int *data)
 Writes an empty NetworkBehaviour reference to the provided memory location.
 
static void WriteFloat (int *data, float f)
 Writes a float value to the provided memory location.
 
static void WriteNetworkBehaviourRef (int *data, NetworkRunner runner, NetworkBehaviour reference)
 Writes a NetworkBehaviour reference to the provided memory location.
 
static void WriteNullBehaviourRef (int *data)
 Writes a null NetworkBehaviour reference to the provided memory location.
 
static void WriteQuaternion (int *data, Quaternion value)
 Writes a Quaternion value to the provided memory location.
 
static void WriteVector2 (int *data, Vector2 value)
 Writes a Vector2 value to the provided memory location.
 
static void WriteVector3 (int *data, Vector3 value)
 Writes a Vector3 value to the provided memory location.
 
static void WriteVector4 (int *data, Vector4 value)
 Writes a Vector4 value to the provided memory location.
 

Static Public Attributes

const float ACCURACY = 1 << 10
 Accuracy of floating point values when serialized.
 

Detailed Description

Provides utility methods for reading and writing data.

Member Function Documentation

◆ ReadFloat()

static float ReadFloat ( int *  data)
static

Reads a float value from the provided memory location.

Parameters
dataThe memory location to read from.
Returns
The float value read from the memory location.

◆ ReadNetworkBehaviourRef()

static NetworkBehaviour ReadNetworkBehaviourRef ( int *  data,
NetworkRunner  runner,
out bool  isValid 
)
static

Reads a NetworkBehaviour reference from the provided memory location. Null is considered valid (0,1).

Parameters
dataThe memory location to read from.
runnerThe NetworkRunner associated with the NetworkBehaviour.
isValidOut parameter indicating whether the read operation was valid.
Returns
The NetworkBehaviour reference read from the memory location.

◆ ReadQuaternion()

static Quaternion ReadQuaternion ( int *  data)
static

Reads a Quaternion value from the provided memory location.

Parameters
dataThe memory location to read from.
Returns
The Quaternion value read from the memory location.

◆ ReadVector2()

static Vector2 ReadVector2 ( int *  data)
static

Reads a Vector2 value from the provided memory location.

Parameters
dataThe memory location to read from.
Returns
The Vector2 value read from the memory location.

◆ ReadVector3()

static Vector3 ReadVector3 ( int *  data)
static

Reads a Vector3 value from the provided memory location.

Parameters
dataThe memory location to read from.
Returns
The Vector3 value read from the memory location.

◆ ReadVector4()

static Vector4 ReadVector4 ( int *  data)
static

Reads a Vector4 value from the provided memory location.

Parameters
dataThe memory location to read from.
Returns
The Vector4 value read from the memory location.

◆ WriteEmptyNetworkBehaviourRef()

static void WriteEmptyNetworkBehaviourRef ( int *  data)
static

Writes an empty NetworkBehaviour reference to the provided memory location.

Parameters
dataThe memory location to write to.

◆ WriteFloat()

static void WriteFloat ( int *  data,
float  f 
)
static

Writes a float value to the provided memory location.

Parameters
dataThe memory location to write to.
fThe float value to write.

◆ WriteNetworkBehaviourRef()

static void WriteNetworkBehaviourRef ( int *  data,
NetworkRunner  runner,
NetworkBehaviour  reference 
)
static

Writes a NetworkBehaviour reference to the provided memory location.

Parameters
dataThe memory location to write to.
runnerThe NetworkRunner associated with the NetworkBehaviour.
referenceThe NetworkBehaviour reference to write.

◆ WriteNullBehaviourRef()

static void WriteNullBehaviourRef ( int *  data)
static

Writes a null NetworkBehaviour reference to the provided memory location.

Parameters
dataThe memory location to write to.

◆ WriteQuaternion()

static void WriteQuaternion ( int *  data,
Quaternion  value 
)
static

Writes a Quaternion value to the provided memory location.

Parameters
dataThe memory location to write to.
valueThe Quaternion value to write.

◆ WriteVector2()

static void WriteVector2 ( int *  data,
Vector2  value 
)
static

Writes a Vector2 value to the provided memory location.

Parameters
dataThe memory location to write to.
valueThe Vector2 value to write.

◆ WriteVector3()

static void WriteVector3 ( int *  data,
Vector3  value 
)
static

Writes a Vector3 value to the provided memory location.

Parameters
dataThe memory location to write to.
valueThe Vector3 value to write.

◆ WriteVector4()

static void WriteVector4 ( int *  data,
Vector4  value 
)
static

Writes a Vector4 value to the provided memory location.

Parameters
dataThe memory location to write to.
valueThe Vector4 value to write.