* Moved doc files to docfx folder * load csproj * doc generation * Run docfx * Add docfx * Deploy docs to mirror-networking.com * use deploy phase * deploy whole generated site * Fixed the semantic release command * Is last \ required? * show debug log * using lftp for site deploy * Testing lftp * Show current folder * try -e command option * Show me the files * use plain ftp * use choco install instead of cinst * fix ssl certificate validation * fix username * Upload site to xmldocs folder * no need to archive docs * No need for debug output * Fix file permissions * show me .htaccess * Show me contents * Wipe out folder to fix permissions * Set file permissions * Fix file permissions * complete toc list * Migrated intro page * Remove old docs * Update link to docs * Add link to github * Only update docs for stuff in master * This is a powershell command * Update doc/articles/Concepts/Communications/RemoteActions.md * Update doc/articles/Concepts/VisibilityCustom.md * Update doc/articles/Concepts/Authority.md * Update doc/articles/Concepts/GameObjects/SpawnObjectCustom.md * Update doc/articles/Concepts/Authority.md * Update doc/articles/Classes/SyncVars.md * No need to run semver twice
1.6 KiB
NetworkBehaviour Callbacks
Like the Network Manager callbacks, there are a number of events relating to network behaviours that can occur over the course of a normal multiplayer game. These include events such as the host starting up, a player joining, or a player leaving. Each of these possible events has an associated callback that you can implement in your own code to take action when the event occurs.
When you create a script which inherits from NetworkBehaviour, you can write your own implementation of what should happen when these events occur. To do this, you override the virtual methods on the NetworkBehaviour
class with your own implementation of what should happen when the given event occurs.
This page lists all the virtual methods (the callbacks) that you can implement on Network Behaviour, and when they occur. A game can run in one of three modes, host, client, or server-only. The callbacks for each mode are listed below:
Callbacks in server mode
When a client connects:
OnStartServer
OnRebuildObservers
Start()
function is called
Callbacks in client mode
When a client connects:
OnStartClient
OnStartLocalPlayer
OnStartAuthority
Start()
function is called
Callbacks in host mode
These are only called on the Player Game Objects when a client connects:
OnStartServer
OnStartClient
OnRebuildObservers
OnStartAuthority
OnStartLocalPlayer
Start()
function is calledOnSetLocalVisibility
On any remaining clients, when a client disconnects:
OnNetworkDestroy