public class Player : NetworkBehaviour
public readonly SyncHashSet<string> buffs = new SyncHashSet<string>();
// this will add the delegate on the client.
// Use OnStartServer instead if you want it on the server
public override void OnStartClient()
buffs.Callback += OnBuffsChanged;
// Process initial SyncHashSet payload
foreach (string buff in buffs)
OnBuffsChanged(SyncSet<string>.Operation.OP_ADD, buff);
// SyncHashSet inherits from SyncSet so use SyncSet here
void OnBuffsChanged(SyncSet<string>.Operation op, string buff)
case SyncSet<string>.Operation.OP_ADD:
// Added a buff to the character
case SyncSet<string>.Operation.OP_REMOVE:
// Removed a buff from the character
case SyncSet<string>.Operation.OP_CLEAR:
// Cleared all buffs from the character