void OnEnable() { if (string.IsNullOrEmpty(_oscAddress)) { _currentAddress = null; return; } var server = OscMaster.GetSharedServer(_udpPort); server.MessageDispatcher.AddCallback(_oscAddress, OnDataReceive); _currentPort = _udpPort; _currentAddress = _oscAddress; if (_floatQueue == null) { _floatQueue = new Queue <float>(MAX_OSC_PARAMS); } if (_floatBuffer == null) { _floatBuffer = new float[MAX_OSC_PARAMS]; } if (_timeOutBuffer == null) { _timeOutBuffer = new float[MAX_OSC_PARAMS]; } }
void Open(int port, string address) { _port = port; _address = address; var server = OscMaster.GetSharedServer(_port); server.MessageDispatcher.AddCallback(_address, OnDataReceive); }
public void Close() { var server = OscMaster.GetSharedServer(_port); server.MessageDispatcher.RemoveCallback(_address, OnDataReceive); _port = 0; _address = null; }
public void Open(int port, string address) { _port = port; _address = address; _queue = new Queue <Vector3>(); var server = OscMaster.GetSharedServer(_port); server.MessageDispatcher.AddCallback(_address, OnDataReceive); }
private void OnDestroy() { if (string.IsNullOrEmpty(oscAddress)) { return; } var server = OscMaster.GetSharedServer(udpPort); server.MessageDispatcher.RemoveCallback(oscAddress, OnDataReceive); }
// Used to store values on initialization //private int _currentPort; #endregion #region MonoBehaviour implementation private void Start() { if (string.IsNullOrEmpty(oscAddress)) { return; } var server = OscMaster.GetSharedServer(udpPort); server.MessageDispatcher.AddCallback(oscAddress, OnDataReceive); Debug.Log(server); }
void OnDisable() { if (string.IsNullOrEmpty(_currentAddress)) { return; } var server = OscMaster.GetSharedServer(_currentPort); server.MessageDispatcher.RemoveCallback(_currentAddress, OnDataReceive); _currentAddress = null; }
void GetSharedServer() { s_SharedServer = OscMaster.GetSharedServer(Port); }