Exemplo n.º 1
0
        public static void Received(OSCReceiver receiver, OSCPacket packet)
        {
            var message = new OSCConsolePacket();

            message.Info       = string.Format("Receiver: {0}. From: {1}", receiver.LocalPort, packet.Ip != null ? packet.Ip.ToString() : "Debug");
            message.PacketType = OSCConsolePacketType.Received;
            message.Packet     = packet;

            Log(message);
        }
Exemplo n.º 2
0
        public static void Transmitted(OSCTransmitter transmitter, OSCPacket packet)
        {
            var message = new OSCConsolePacket();

            message.Info       = string.Format("Transmitter: {0}:{1}", transmitter.RemoteHost, transmitter.RemotePort);
            message.PacketType = OSCConsolePacketType.Transmitted;
            message.Packet     = packet;

            Log(message);
        }
Exemplo n.º 3
0
        private static void Log(OSCConsolePacket message)
        {
#if UNITY_EDITOR
            // COPY PACKET
            var rawData = OSCConverter.Pack(message.Packet);
            message.Packet = OSCConverter.Unpack(rawData);

            _consoleBuffer.Add(message);
#else
            if (_logConsole)
            {
                Debug.LogFormat("[OSCConsole] Packed {0}: {1}", message.PacketType, message.Packet);
            }
#endif
        }