Skip to content

Mirror::SyncObject

A sync object is an object that can synchronize it's state between server and client, such as a SyncList

Inherited by SyncIDictionary< TKey, TValue >, SyncList< T >, SyncSet< T >

Public Functions

Name
void Flush()
Discard all the queued changes
void OnSerializeAll(NetworkWriter writer)
Write a full copy of the object
void OnSerializeDelta(NetworkWriter writer)
Write the changes made to the object since last sync
void OnDeserializeAll(NetworkReader reader)
Reads a full copy of the object
void OnDeserializeDelta(NetworkReader reader)
Reads the changes made to the object since last sync
void Reset()
Resets the SyncObject so that it can be re-used

Public Properties

Name
bool IsDirty
true if there are changes since the last flush

Public Functions Documentation

function Flush

void Flush()

Discard all the queued changes

Reimplemented by: Mirror::SyncSet::Flush, Mirror::SyncIDictionary::Flush, Mirror::SyncList::Flush

Consider the object fully synchronized with clients

function OnSerializeAll

void OnSerializeAll(
    NetworkWriter writer
)

Write a full copy of the object

Parameters:

  • writer

Reimplemented by: Mirror::SyncSet::OnSerializeAll, Mirror::SyncIDictionary::OnSerializeAll, Mirror::SyncList::OnSerializeAll

function OnSerializeDelta

void OnSerializeDelta(
    NetworkWriter writer
)

Write the changes made to the object since last sync

Parameters:

  • writer

Reimplemented by: Mirror::SyncSet::OnSerializeDelta, Mirror::SyncIDictionary::OnSerializeDelta, Mirror::SyncList::OnSerializeDelta

function OnDeserializeAll

void OnDeserializeAll(
    NetworkReader reader
)

Reads a full copy of the object

Parameters:

  • reader

Reimplemented by: Mirror::SyncSet::OnDeserializeAll, Mirror::SyncIDictionary::OnDeserializeAll, Mirror::SyncList::OnDeserializeAll

function OnDeserializeDelta

void OnDeserializeDelta(
    NetworkReader reader
)

Reads the changes made to the object since last sync

Parameters:

  • reader

Reimplemented by: Mirror::SyncSet::OnDeserializeDelta, Mirror::SyncIDictionary::OnDeserializeDelta, Mirror::SyncList::OnDeserializeDelta

function Reset

void Reset()

Resets the SyncObject so that it can be re-used

Reimplemented by: Mirror::SyncIDictionary::Reset, Mirror::SyncSet::Reset, Mirror::SyncList::Reset

Public Property Documentation

property IsDirty

bool IsDirty;

true if there are changes since the last flush


Updated on 22 January 2021 at 08:52:36 UTC