OnValueSyncedAttribute. This attribute lets you define a method that will be called each time a value of a synced member (field or property) changes in the non-simulated version of an entity.
Healthfield gets updated (synced with its simulated version) the
UpdateHealthLabelwill be called automatically, changing the health label text and printing a log with a health difference.
Playerentity state introduced by the Simulator, updating the visual representation (which the Simulator doesn't need).
OnValueSyncedfeature can be used only on members of user-defined types, that is, there's no way to be notified about a change in the value of a Unity type member, like
transform.position. This might however change in the future, so stay tuned!