public bool Open(int port) { _queue = new Queue <OSCMessage>(); #if UNITY_EDITOR if (PlayerSettings.runInBackground == false) { Debug.LogWarning("Recommend PlayerSettings > runInBackground = true"); } #endif if (_server != null) { _server.Close(); } try { _server = new OSCServer(port); _server.SleepMilliseconds = 0; _server.PacketReceivedEvent += didReceivedEvent; } catch (Exception e) { Debug.LogError("[" + Name + "] Couldn't open port " + port + " | " + e.Message); return(false); } return(true); }
public void Open(int port) { if (_server != null) { _server.Close(); } _server = new OSCServer(port); _server.SleepMilliseconds = 0; _server.PacketReceivedEvent += didRecievedEvent; }
public void Open(int port) { #if UNITY_EDITOR if (PlayerSettings.runInBackground == false) { Debug.LogWarning("Recommend PlayerSettings > runInBackground = true"); } #endif if (_server != null) { _server.Close(); } _server = new OSCServer(port); _server.SleepMilliseconds = 0; _server.PacketReceivedEvent += didRecievedEvent; }