private IEnumerator Start() { var c = WakeNetConfig.Default; c.LogLevel = NetworkLogLevel.Full; WakeNet.Init(c); while (!WakeNet.Initialized) { yield return(new WaitForEndOfFrame()); } _discovery = WakeNet.CreateDiscovery(_port, _key, _version, _subversion); _discovery.Search(); }
// Use this for initialization IEnumerator Start() { var c = WakeNetConfig.Default; c.LogLevel = NetworkLogLevel.Full; WakeNet.Init(c); while (!WakeNet.Initialized) { yield return(new WaitForEndOfFrame()); } _discovery = WakeNet.CreateDiscovery(_port, _key, _version, _subversion); _discovery.Broadcast(ColorUtility.ToHtmlStringRGBA(_broadcastColor), _serverPort); GetComponent <Image>().color = _broadcastColor; }
IEnumerator Start() { var c = WakeNetConfig.Default; c.LogLevel = NetworkLogLevel.Full; WakeNet.Init(c); while (!WakeNet.Initialized) { yield return(new WaitForEndOfFrame()); } _server = WakeNet.CreateServer(_serverMaxConnections, _serverPort); _server.ClientConnected += OnClientConnected; _proxy = _server.AddProxy <ChatMessagePacket, ChatMessagePacket>("msg", 0); _proxy.Received += OnMessageReceived; }