public void SendEvent(string name) { using (var frame = m_Context.DoFrame()) { frame.Write("e", name); } }
IEnumerator Update() { while (isActive) { if (reciever.hasWaitingMessages()) { reciever.getLastMessages(datas, messages); if (m_Context != null) { using (var frame = m_Context.DoFrame()) { for (int i = 0; i < messages.Length; i++) { if (messages[i] != null) { frame.Write(frameValues[i], getData(messages[i])); } else { frame.Write(frameValues[i], new Quaternion(0, 0, 0, 0)); } } } } currentFrame++; } yield return(null); } }
IEnumerator Update() { while (isActive) { using (var frame = m_Context.DoFrame()) { frame.Write("r", rate); } yield return(new WaitForSeconds(0.25f)); } }
IEnumerator CollectFrame() { while (m_Active) { using (var frame = m_Context.DoFrame()) { frame.Write("rr", Input.gyro.rotationRate); frame.Write("g", Input.gyro.gravity); frame.Write("ua", Input.gyro.userAcceleration); frame.Write("rru", Input.gyro.rotationRateUnbiased); frame.Write("a", Input.gyro.attitude); } yield return(null); } }
IEnumerator CollectFrame() { while (isActive) { if (Input.touchCount > 0) { for (int i = 0; i < Input.touchCount; i++) { using (var frame = m_Context.DoFrame()) { Touch touch = Input.GetTouch(i); Vector2 pos = new Vector2(touch.position.x / Screen.width, touch.position.x / Screen.height); frame.Write($"c", pos); frame.Write($"p", touch.pressure); } } } yield return(null); } }