void Start() { handler = OSCHandler.Instance; handler.Init("Max", address, sendPort); handler.transform.SetParent(gameObject.transform); receiver = new OSCReceiver(); receiver.Open(receivePort); }
private void OnEnable() { if (propQueryMap == null) { propQueryMap = new Dictionary <WSQuery, List <string> >(); } if (propQueryPreviousValues == null) { propQueryPreviousValues = new Dictionary <string, object>(); } if (filteredComponentNames.Count == 0) { filteredComponentNames.Add("MeshRenderer"); filteredComponentNames.Add("MeshFilter"); filteredComponentNames.Add("BoxCollider"); filteredComponentNames.Add("MeshCollider"); } if (Application.isPlaying) { httpServer = new HttpServer(localPort); httpServer.OnGet += handleHTTPRequest; httpServer.Start(); if (httpServer.IsListening) { Debug.Log("OSCQuery Server started on port " + localPort); } else { Debug.LogWarning("OSCQuery could not start on port " + localPort); } httpServer.AddWebSocketService("/", createWSQuery); receiver = new OSCReceiver(); receiver.Open(localPort); oscService = new RegisterService(); oscService.Name = serverName; oscService.RegType = "_osc._udp"; oscService.ReplyDomain = "local."; oscService.UPort = (ushort)localPort; oscService.Register(); zeroconfService = new RegisterService(); zeroconfService.Name = serverName; zeroconfService.RegType = "_oscjson._tcp"; zeroconfService.ReplyDomain = "local."; zeroconfService.UPort = (ushort)localPort; zeroconfService.Register(); } rebuildDataTree(); }
void Start() { receiver = new OSCReceiver(); receiver.Open(port); if (updateEvent == null) { updateEvent = new StringEvent(); } }
public static OSCReceiver CreateReceiver(string receiverId, int port) { var receiver = new OSCReceiver { Name = receiverId }; if (!receiver.Open(port)) { return(null); } Receivers.Add(receiverId, receiver); if (Instance.ShowDebug) { Debug.Log("Receiver " + receiverId + " on " + port + " created."); } return(receiver); }
// Use this for initialization void Start() { receiver = new OSCReceiver(); receiver.Open(port); }
// Use this for initialization void Start() { receiver = new OSCReceiver(); receiver.Open(port); receiver.messageReceived += HandleMessage; }