/// <summary>
        ///     Check if new received fidelity parameters or upload telemetry request were stored,
        ///     and call their callbacks. The C# callbacks are not called directly from the native
        ///     TuningFork callbacks to avoid crashes due to running in a different thread
        ///     than what Unity is expecting.
        /// </summary>
        IEnumerator CallbacksCheck()
        {
            while (true)
            {
                yield return(new WaitForFixedUpdate());

                if (m_ReceivedFidelityParameters != null)
                {
                    if (onReceiveFidelityParameters != null)
                    {
                        onReceiveFidelityParameters(m_ReceivedFidelityParameters);
                    }
                    m_ReceivedFidelityParameters = null;
                }

                if (m_UploadTelemetryRequest != null)
                {
                    if (onReceiveUploadLog != null)
                    {
                        onReceiveUploadLog(m_UploadTelemetryRequest);
                    }
                    m_UploadTelemetryRequest = null;
                }
            }
        }
 static void UploadCallbackImpl(IntPtr bytes, uint size)
 {
     if (s_Tuner == null || s_Tuner.onReceiveUploadLog == null)
     {
         return;
     }
     s_Tuner.m_UploadTelemetryRequest = UploadTelemetryRequest.Parse(bytes, size);
 }
Exemplo n.º 3
0
 static void UploadCallbackImpl(IntPtr bytes, uint size)
 {
     if (s_ActiveTf == null || s_ActiveTf.onReceiveUploadLog == null)
     {
         return;
     }
     // Don't call OnReceiveUploadLog directly from this thread.
     s_ActiveTf.m_UploadTelemetryRequest = UploadTelemetryRequest.Parse(bytes, size);
 }