Ejemplo n.º 1
0
        /// <summary>
        /// Register to get Tango event callbacks.
        ///
        /// NOTE: Tango event callbacks happen on a different thread than the main
        /// Unity thread.
        /// </summary>
        internal static void SetCallback()
        {
            if (m_onEventAvailableCallback != null)
            {
                Debug.Log("TangoEventListener.SetCallback() called when callback is already set.");
                return;
            }

            Debug.Log("TangoEventListener.SetCallback()");
            m_onEventAvailableCallback = new TangoEventProvider.APIOnEventAvailable(_OnEventAvailable);
            TangoEventProvider.SetCallback(m_onEventAvailableCallback);
        }
        /// <summary>
        /// Stop getting Tango event callbacks.
        /// </summary>
        internal static void Reset()
        {
            // Avoid calling into tango_client_api before the correct library is loaded.
            if (m_onEventAvailableCallback != null)
            {
                TangoEventProvider.ClearCallback();
            }

            m_onEventAvailableCallback = null;
            m_onTangoEventAvailable = null;
            m_onTangoEventMultithreadedAvailable = null;
            m_tangoEvent = new TangoEvent();
            m_isDirty = false;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Stop getting Tango event callbacks.
        /// </summary>
        internal static void Reset()
        {
            // Avoid calling into tango_client_api before the correct library is loaded.
            if (m_onEventAvailableCallback != null)
            {
                TangoEventProvider.ClearCallback();
            }

            m_onEventAvailableCallback           = null;
            m_onTangoEventAvailable              = null;
            m_onTangoEventMultithreadedAvailable = null;
            m_tangoEvent = new TangoEvent();
            m_isDirty    = false;
        }
        /// <summary>
        /// Register to get Tango event callbacks.
        /// 
        /// NOTE: Tango event callbacks happen on a different thread than the main
        /// Unity thread.
        /// </summary>
        internal static void SetCallback()
        {
            if (m_onEventAvailableCallback != null)
            {
                Debug.Log("TangoEventListener.SetCallback() called when callback is already set.");
                return;
            }

            Debug.Log("TangoEventListener.SetCallback()");
            m_onEventAvailableCallback = new TangoEventProvider.APIOnEventAvailable(_OnEventAvailable);
            TangoEventProvider.SetCallback(m_onEventAvailableCallback);
        }