Improving docs 1 (#1878)

* Update NetworkBehaviour.md

* Update Attributes.md

* Update doc/Guides/NetworkBehaviour.md

Co-authored-by: MrGadget <chris@clevertech.net>

Co-authored-by: MrGadget <chris@clevertech.net>
This commit is contained in:
James Frowen 2020-05-11 09:29:09 +01:00 committed by GitHub
parent 37323d319b
commit 2db3fdc19c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -6,13 +6,13 @@ These attributes can be used for Unity game loop methods like Start or Update, a
- **NetworkSettings**
This attribute has been deprecated because `channels` were moved to transports (where applicable) and `interval` was moved to an inspector property
- **Server**
means don't allow a client to call that method (throws a warning or an error when called on a client).
Only a server can call the method (throws a warning or an error when called on a client).
- **ServerCallback**
A Custom Attribute that can be added to member functions of NetworkBehaviour scripts, to make them only run on servers.
Same as **Server** but does not throw warning when called on client.
- **Client**
means don't allow a server to call that method (throws a warning or an error when called on the server).
Only a Client can call the method (throws a warning or an error when called on the server).
- **ClientCallback**
A Custom Attribute that can be added to member functions of NetworkBehaviour scripts, to make them only run on clients, but not generate warnings.
Same as **Client** but does not throw warning when called on server.
- **ClientRpc**
The server uses a Remote Procedure Call (RPC) to run that function on clients. See also: [Remote Actions](Communications/RemoteActions.md)
- **TargetRpc**

View File

@ -57,7 +57,7 @@ public class SpaceShip : NetworkBehaviour
The built-in callbacks are:
- **OnStartServer** called on server when a game object spawns on the server, or when the server is started for game objects in the Scene
- **OnStopServer** called on server when a game object spawns on the server, or when the server is stopped for game objects in the Scene
- **OnStopServer** called on server when a game object is destroyed on the server, or when the server is stopped for game objects in the Scene
- **OnStartClient** called on clients when the game object spawns on the client, or when the client connects to a server for game objects in the Scene
- **OnStopClient** called on clients when the server destroys the game object
- **OnStartLocalPlayer** called on clients for player game objects on the local client (only)