SyncHashSet
SyncHashSet
are sets similar to C# HashSet that synchronize their contents from the server to the clients.
A SyncHashSet can contain any supported mirror type
Usage
SyncHashSet must be declared readonly and initialized in the constructor.
Add a SyncHashSet field to your NetworkBehaviour class. For example:
You can also detect when a SyncHashSet changes. This is useful for refreshing your character in the client or determining when you need to update your database.
Subscribe to the Callback event typically during Start
, OnClientStart
or OnServerStart
for that.
Note that by the time you subscribe, the set will already be populated, so you will not get a call for the initial data, only updates.
Last updated