/// <summary> /// Init HMD device. /// </summary> public void Init() { if (m_IsInit) { return; } NRTools.Init(); Loom.Initialize(); #if UNITY_ANDROID && !UNITY_EDITOR // Init before all actions. AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); m_UnityActivity = cls_UnityPlayer.GetStatic <AndroidJavaObject>("currentActivity"); NativeApi.NRSDKInitSetAndroidActivity(m_UnityActivity.GetRawObject()); #endif m_IsInit = true; }
/// <summary> /// Init HMD device. /// </summary> public void Init() { if (m_IsInit || isGlassesPlugOut) { return; } NRTools.Init(); MainThreadDispather.Initialize(); #if UNITY_ANDROID && !UNITY_EDITOR // Init before all actions. AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); m_UnityActivity = cls_UnityPlayer.GetStatic <AndroidJavaObject>("currentActivity"); NativeApi.NRSDKInitSetAndroidActivity(m_UnityActivity.GetRawObject()); #endif CreateGlassesController(); CreateHMD(); m_IsInit = true; }