Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        KnownPeople = new HashSet <NetworkInfo>();
        Serializer  = new JSONPacketSerializer();

        //
        Network = new NetworkHost(9560, 1);
        Network.ConfigureChannel("broadcast", ChannelType.UnreliableUnordered);
        Network.Open();

        // Mark broadcast credentials
        Network.SetBroadcastCredentials(1234, 1);

        //
        NetworkHost.StartBroadcast(Network, Encoding.ASCII.GetBytes(NetworkHost.GetLocalAddress()));

        //
        var textUi = GetComponent <Text>();

        textUi.text = "";
    }