counterand the method
NextNumberfor syncing in the bindings window. To make the counter behave like we want, mark the Prefab as "Persistent" and give it a unique persistence ID, e.g. "THE_COUNTER". Also change the adoption behaviour to "Auto Adopt":
NumberRequester.cs. This will be an example MonoBehaviour that requests a unique number by sending the command
GetNumberto the Counter Prefab. As a single argument to this command, the
NumberRequesterwill send an entity reference to itself. This makes it possible for the Counter to send back a response command (
GotNumber) with the number that was generated. In this simple example we just log the number to the console.
GotNumberfor syncing in the bindings window.