/// <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(); } } } }
/// <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!"); } }
/// <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!"); } }
/// <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!"); } } }
/// <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; } }
/// <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!"); } } }
/// <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."); } }