Smooth Sync for Unity
Syncs your networked objects smoothly according to the network owner.
Smooth.NetworkState Class Reference

Wraps the State in the NetworkMessage so we can send it over the network. More...

Inherits MessageBase.

Public Member Functions

void copyFromSmoothSync (SmoothSync smoothSyncScript)
 Copy the SmoothSync object to a NetworkState. More...
 
override void Deserialize (NetworkReader reader)
 Deserialize a message from the network. More...
 
 NetworkState ()
 Default contstructor, does nothing. More...
 
override void Serialize (NetworkWriter writer)
 Serialize the message over the network. More...
 

Public Attributes

SmoothSync smoothSync
 The SmoothSync object associated with this State. More...
 
State state = new State()
 The State that will be sent over the network More...
 

Detailed Description

Wraps the State in the NetworkMessage so we can send it over the network.

This only sends and receives the parts of the State that are enabled on the SmoothSync component.

Constructor & Destructor Documentation

◆ NetworkState()

Smooth.NetworkState.NetworkState ( )
inline

Default contstructor, does nothing.

Member Function Documentation

◆ copyFromSmoothSync()

void Smooth.NetworkState.copyFromSmoothSync ( SmoothSync  smoothSyncScript)
inline

Copy the SmoothSync object to a NetworkState.

Parameters
smoothSyncScriptThe SmoothSync object

◆ Deserialize()

override void Smooth.NetworkState.Deserialize ( NetworkReader  reader)
inline

Deserialize a message from the network.

Only receives what it needs and decompresses floats if you chose to.

Parameters
writerThe Networkreader to read from.

◆ Serialize()

override void Smooth.NetworkState.Serialize ( NetworkWriter  writer)
inline

Serialize the message over the network.

Only sends what it needs and compresses floats if you chose to.

Parameters
writerThe NetworkWriter to write to.

Member Data Documentation

◆ smoothSync

SmoothSync Smooth.NetworkState.smoothSync

The SmoothSync object associated with this State.

◆ state

State Smooth.NetworkState.state = new State()

The State that will be sent over the network