/// <summary>
        /// Connect to the Tango Service.
        /// </summary>
        private void _TangoConnect()
        {
            if (!m_isServiceInitialized)
            {
                return;
            }

            if (!m_isServiceConnected)
            {
                m_isServiceConnected = true;
                AndroidHelper.PerformanceLog("Unity _TangoConnect start");
                if (TangoServiceAPI.TangoService_connect(m_callbackContext, m_tangoConfig.GetHandle()) != Common.ErrorType.TANGO_SUCCESS)
                {
                    AndroidHelper.ShowAndroidToastMessage("Failed to connect to Tango Service.");
                    Debug.Log(CLASS_NAME + ".Connect() Could not connect to the Tango Service!");
                }
                else
                {
                    AndroidHelper.PerformanceLog("Unity _TangoConnect end");
                    Debug.Log(CLASS_NAME + ".Connect() Tango client connected to service!");

                    if (OnTangoConnect != null)
                    {
                        OnTangoConnect();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Disconnect from the Tango Service.
 /// </summary>
 private void _TangoDisconnect()
 {
     if (TangoServiceAPI.TangoService_disconnect() != Common.ErrorType.TANGO_SUCCESS)
     {
         DebugLogger.GetInstance.WriteToLog(DebugLogger.EDebugLevel.DEBUG_CRITICAL,
                                            CLASS_NAME + ".Disconnect() Could not disconnect from the Tango Service!");
     }
     else
     {
         DebugLogger.GetInstance.WriteToLog(DebugLogger.EDebugLevel.DEBUG_INFO,
                                            CLASS_NAME + ".Disconnect() Tango client disconnected from service!");
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Connect to the Tango Service.
 /// </summary>
 private void _TangoConnect()
 {
     if (TangoServiceAPI.TangoService_connect(m_callbackContext, TangoConfig.GetConfig()) != Common.ErrorType.TANGO_SUCCESS)
     {
         DebugLogger.GetInstance.WriteToLog(DebugLogger.EDebugLevel.DEBUG_CRITICAL,
                                            CLASS_NAME + ".Connect() Could not connect to the Tango Service!");
     }
     else
     {
         DebugLogger.GetInstance.WriteToLog(DebugLogger.EDebugLevel.DEBUG_INFO,
                                            CLASS_NAME + ".Connect() Tango client connected to service!");
     }
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Connect to the Tango Service.
 /// </summary>
 private void _TangoConnect()
 {
     if (!m_isServiceConnected)
     {
         m_isServiceConnected = true;
         if (TangoServiceAPI.TangoService_connect(m_callbackContext, TangoConfig.GetConfig()) != Common.ErrorType.TANGO_SUCCESS)
         {
             Debug.Log(CLASS_NAME + ".Connect() Could not connect to the Tango Service!");
         }
         else
         {
             Debug.Log(CLASS_NAME + ".Connect() Tango client connected to service!");
         }
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Disconnect from the Tango Service.
 /// </summary>
 private void _TangoDisconnect()
 {
     Debug.Log(CLASS_NAME + ".Disconnect() Disconnecting from the Tango Service");
     m_isDisconnecting    = true;
     m_isServiceConnected = false;
     if (TangoServiceAPI.TangoService_disconnect() != Common.ErrorType.TANGO_SUCCESS)
     {
         Debug.Log(CLASS_NAME + ".Disconnect() Could not disconnect from the Tango Service!");
         m_isDisconnecting = false;
     }
     else
     {
         Debug.Log(CLASS_NAME + ".Disconnect() Tango client disconnected from service!");
         m_isDisconnecting = false;
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Connect to the Tango Service.
 /// </summary>
 private void _TangoConnect()
 {
     if (!m_isServiceConnected)
     {
         m_isServiceConnected = true;
         AndroidHelper.PerformanceLog("Unity _TangoConnect start");
         if (TangoServiceAPI.TangoService_connect(m_callbackContext, TangoConfig.GetConfig()) != Common.ErrorType.TANGO_SUCCESS)
         {
             Debug.Log(CLASS_NAME + ".Connect() Could not connect to the Tango Service!");
         }
         else
         {
             AndroidHelper.PerformanceLog("Unity _TangoConnect end");
             Debug.Log(CLASS_NAME + ".Connect() Tango client connected to service!");
         }
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Initialize the Tango Service.
 /// </summary>
 private void _TangoInitialize()
 {
     if (_IsValidTangoAPIVersion())
     {
         int status = TangoServiceAPI.TangoService_initialize(IntPtr.Zero, IntPtr.Zero);
         if (status != Common.ErrorType.TANGO_SUCCESS)
         {
             Debug.Log("-------------------Tango initialize status : " + status);
             Debug.Log(CLASS_NAME + ".Initialize() The service has not been initialized!");
         }
         else
         {
             Debug.Log(CLASS_NAME + ".Initialize() Tango was initialized!");
         }
     }
     else
     {
         Debug.Log(CLASS_NAME + ".Initialize() Invalid API version. please update to minimul API version.");
     }
 }