Skip to content

Commit bc56c36

Browse files
authored
docs: Updated NetworkedVar documentation (#316)
Updated NetworkedVar documentation to emphasis the default ownership. I would probably also write why it is the default and if the write permission can be changed after initalization, I lack knowledge to do that however. I am new to this project so I am aware I might be not using the correct terminology. Criticism welcome.
1 parent 310999e commit bc56c36

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/_docs/the-basics/networkedvar.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ Since the NetworkedVar container is a wrapper container around the value, the va
2121

2222
To create your own NetworkedVar container, simply create a class with the INetworkedVar interface and declare it as a field of a NetworkedBehaviour. To learn how to write your own containers for more complex structures, see the NetworkedVar implementation. To learn how to do custom delta encoding on complex structures. See the SyncedDictionary and SyncedLIst implementations.
2323

24+
### Permissions
25+
By default NetworkedVar and it's subclasses can only be wrote to by the server (NetworkedVarPermission.ServerOnly). To change that set the permission to the desired value during initialization:
26+
```csharp
27+
private NetworkedVar<float> myFloat = new NetworkedVar(new NetworkedVarSettings {WritePermission = NetworkedVarPermission.OwnerOnly}, 5);
28+
```
2429

2530
### Example
2631
```csharp

0 commit comments

Comments
 (0)