Beispiel #1
0
    IEnumerator WriteUpdate()
    {
        var wait = new WaitForSeconds(0.5f);

        for (;;)
        {
            yield return(wait);

            if (m_isConnect)
            {
                m_buffer = JsonBinaryUtility.ToByteArray(Input.acceleration);
                if (!Bluetooth.Write(m_buffer))
                {
                    Bluetooth.Close();
                    m_isConnect = false;
                }
                // bufferのクリア
                for (int i = 0; i < m_buffer.Length; ++i)
                {
                    m_buffer[i] = 0;
                }
            }
        }
    }
Beispiel #2
0
 private void OnDisable()
 {
     Bluetooth.Close();
 }