void OnDisable() { // When object is deselected in Edit Mode then we stop listening. if (!Application.isPlaying && _oscOut.isOpen) { _oscOut.Close(); } // Unsubscribe from messsages. _oscOut.UnmapAnyMessage(OnOSCMessage); }
void OnMessageVisibilityChanged(bool visible) { messageContainer.SetActive(visible); if (visible) { oscOut.MapAnyMessage(OnAnyMessage); messagesToggleLabel.text = messageToggleTextEnabled; } else { oscOut.UnmapAnyMessage(OnAnyMessage); messagesToggleLabel.text = messageToggleTextDisabled; _messageStringQueue.Clear(); } }