Added snippets to unity plugin readme

This commit is contained in:
Joseph Henry
2016-06-20 16:39:41 -07:00
parent 821edd3664
commit 8200aa2b92

View File

@@ -6,7 +6,8 @@ We've tried to replicate the behavior of the Unity3D LLAPI to make using ZeroTie
To start things off, go check out [ZeroTierSockets_Demo.cs](). Here are some examples of how to use the `ZeroTierNetworkInterface`:
## Server example
## Using ZeroTier Sockets API
### Server example
```
Thread connectThread = new Thread(() => {
// Create ZeroTier-administered socket
@@ -38,10 +39,9 @@ Thread connectThread = new Thread(() => {
});
connectThread.IsBackground = true;
connectThread.Start();
}
```
## Client example
### Client example
```
Thread connectThread = new Thread(() => {
@@ -59,8 +59,8 @@ Thread connectThread = new Thread(() => {
***
## Creating a host and receiving data
## Using the ZeroTier Low-level API (LLAPI)
### Creating a host and receiving data
```
public class MyObject
@@ -98,7 +98,7 @@ public class MyObject
}
```
## Connecting to a server and sending a message
### Connecting to a server and sending a message
```
public class MyObject