DataStream

ObjectNet provides the facility to send and receive simple and complex structures over the network.

This structure is a class that needs to implement IDataStream interface. ObjectNet has already the following types :

  • Int16 : Int16Stream

  • UInt16 : UInt16Stream

  • Int32 : Int32Stream

  • UInt32 : UInt32Stream

  • float : FloatStream

  • double : DoubleStream

  • bool : BooleanStream

  • string : StringStream

  • Color : ColorStream

  • byte : ByteStream

  • sbyte : SByteStream

  • byte[] : ByteArrayStream

  • Vector2 : Vector2Stream

  • Vector3 : Vector3Stream

  • Vector4 : Vector4Stream

  • Quaternion : QuaternionStream

  • Matrix4x4 : Matrix4x4Stream

The main idea of DataStream is to write and read data without the need to write on each place, you can use some DataStream and encapsulate how much data you need.

To implement your own DataStream you can check the API document on NetworkEntity class ( see Custom DataStream ).