Basic Networking done
This commit is contained in:
28
Assets/Mirror/Runtime/SyncObject.cs
Normal file
28
Assets/Mirror/Runtime/SyncObject.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace Mirror
|
||||
{
|
||||
/// <summary>SyncObjects sync state between server and client. E.g. SyncLists.</summary>
|
||||
public interface SyncObject
|
||||
{
|
||||
/// <summary>True if there are changes since the last flush</summary>
|
||||
bool IsDirty { get; }
|
||||
|
||||
/// <summary>Discard all the queued changes</summary>
|
||||
// Consider the object fully synchronized with clients
|
||||
void Flush();
|
||||
|
||||
/// <summary>Write a full copy of the object</summary>
|
||||
void OnSerializeAll(NetworkWriter writer);
|
||||
|
||||
/// <summary>Write the changes made to the object since last sync</summary>
|
||||
void OnSerializeDelta(NetworkWriter writer);
|
||||
|
||||
/// <summary>Reads a full copy of the object</summary>
|
||||
void OnDeserializeAll(NetworkReader reader);
|
||||
|
||||
/// <summary>Reads the changes made to the object since last sync</summary>
|
||||
void OnDeserializeDelta(NetworkReader reader);
|
||||
|
||||
/// <summary>Resets the SyncObject so that it can be re-used</summary>
|
||||
void Reset();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user