Пример #1
0
        void HandleServerChanges()
        {
            if (OscServer.PortToServer.Count > m_PreviousServerCount)
            {
                m_Server = OscServer.PortToServer.First().Value;
                m_Server.AddMonitorCallback(Monitor);
                m_ServerLabel         = $"Messages being received on port {m_Server.Port}";
                m_ShowNoServerWarning = false;

                if (!Application.isPlaying)
                {
                    EditorApplication.update += Update;
                }
            }
            else if (OscServer.PortToServer.Count < m_PreviousServerCount)
            {
                m_Server?.RemoveMonitorCallback(Monitor);
                m_Server              = null;
                m_ServerLabel         = null;
                m_ShowNoServerWarning = true;
                m_PreviousServerCount = OscServer.PortToServer.Count;

                if (!Application.isPlaying)
                {
                    EditorApplication.update -= Update;
                }
            }

            m_PreviousServerCount = OscServer.PortToServer.Count;
        }
Пример #2
0
 void HandleServerChanges()
 {
     if (m_PreviousServerCount == 0 && OscServer.PortToServer.Count > 0)
     {
         m_Server = OscServer.PortToServer.First().Value;
         m_Server.AddMonitorCallback(Monitor);
         m_PreviousServerCount = OscServer.PortToServer.Count;
         m_ServerLabel         = $"Messages being received on port {m_Server.Port}";
         m_ShowNoServerWarning = false;
     }
     else if (m_PreviousServerCount > 0 && OscServer.PortToServer.Count == 0)
     {
         m_Server?.RemoveMonitorCallback(Monitor);
         m_Server              = null;
         m_ServerLabel         = null;
         m_ShowNoServerWarning = true;
         m_PreviousServerCount = OscServer.PortToServer.Count;
     }
 }
Пример #3
0
 void OnEnable()
 {
     m_ActiveQueueBuffer = m_ToQueue;
     m_Server            = OscServer.PortToServer.First().Value;
     m_Server.AddMonitorCallback(Monitor);
 }