void Update() { while (true) { var data = UnityMidiReceiver.DequeueIncomingData(); if (data == 0) { break; } var message = new MidiMessage(data); messageQueue.Enqueue(message); //nanoKontrol2スクリプトへデータを渡す nanoKontrol2.qued((int)message.status, (int)message.data1, (int)message.data2); #if UNITY_EDITOR messageHistory.Enqueue(message); #endif } #if UNITY_EDITOR while (messageHistory.Count > 8) { messageHistory.Dequeue(); } #endif }
void Update() { while (true) { var data = UnityMidiReceiver.DequeueIncomingData(); if (data == 0) { break; } var message = new MidiMessage(data); _dispatcher((int)message.data1, (float)message.data2 / 127f); } }
void Update() { while (true) { var data = UnityMidiReceiver.DequeueIncomingData(); if (data == 0) { break; } var message = new MidiMessage(data); messageQueue.Enqueue(message); #if UNITY_EDITOR messageHistory.Enqueue(message); #endif } #if UNITY_EDITOR while (messageHistory.Count > 8) { messageHistory.Dequeue(); } #endif }