Пример #1
0
    // TODO: change this to an independent variable.

    // called so that the server is initialized as early as possible.
    // this wasn't initialized in time during testing due to initialization order.
    private void Awake()
    {
        // creates client if it's not set.
        if (client == null)
        {
            client = new NetworkLibrary.UdpClient();

            // two-way communication
            client.SetCommunicationMode(NetworkLibrary.UdpClient.mode.both);
        }
    }
Пример #2
0
 // sets the communication mode
 public static void SetCommunicationMode(UdpClient.mode newMode)
 {
     client.SetCommunicationMode(newMode);
 }