void FirstStart() { Screen.sleepTimeout = SleepTimeout.NeverSleep; Application.targetFrameRate = 60; Application.runInBackground = runInBackground; //Debug.Log ("NuitrackStart"); if (asyncInit) { StartCoroutine(InitEventStart()); if (!_threadRunning) { _thread = new Thread(ThreadedWork); _thread.Start(); } } else { initState = NuitrackLoader.InitNuitrackLibraries(); if (initEvent != null) { initEvent.Invoke(initState); } #if UNITY_ANDROID && !UNITY_EDITOR if (IsNuitrackLibrariesInitialized()) #endif NuitrackInit(); } }
public static NuitrackInitState InitNuitrackLibraries() { #if UNITY_ANDROID && !UNITY_EDITOR Debug.Log("InitNuitrackLibraries() starts."); try { initComplete = false; AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject jo = jc.GetStatic <AndroidJavaObject>("currentActivity"); AndroidJavaClass javaNuitrackClass = new AndroidJavaClass("com.tdv.nuitrack.sdk.Nuitrack"); javaNuitrackClass.CallStatic("init", jo, new NuitrackCallback()); while (!initComplete) { Thread.Sleep(50); } } catch (System.Exception ex) { Debug.Log("Exception: " + ex); } #else initState = NuitrackInitState.INIT_OK; #endif return(initState); }
// tries to initialize Nuitrack private bool NuitrackInit() { bool bInited = false; if (initState != NuitrackInitState.INIT_OK) { initState = NuitrackLoader.InitNuitrackLibraries(); } if (initState == NuitrackInitState.INIT_OK) { try { #if UNITY_IOS nuitrack.Nuitrack.Init("", nuitrack.Nuitrack.NuitrackMode.DEBUG); #else nuitrack.Nuitrack.Init(); #endif bInited = true; Screen.sleepTimeout = SleepTimeout.NeverSleep; } catch (Exception ex) { Debug.Log(ex.ToString()); } } return(bInited); }
void Awake() { exceptionsLogger = GameObject.FindObjectOfType <ExceptionsLogger>(); NuitrackInitState state = NuitrackLoader.InitNuitrackLibraries(); if (state != NuitrackInitState.INIT_OK) { exceptionsLogger.AddEntry("Nuitrack native libraries iniialization error: " + Enum.GetName(typeof(NuitrackInitState), state)); } }
void Awake() { exceptionsLogger = GameObject.FindObjectOfType <ExceptionsLogger>(); NuitrackInitState state = NuitrackManager.Instance.InitState; if (state != NuitrackInitState.INIT_OK && Application.platform == RuntimePlatform.Android) { string error_message = "Nuitrack native libraries initialization error: " + Enum.GetName(typeof(NuitrackInitState), state); exceptionsLogger.AddEntry(NuitrackErrorSolver.CheckError(error_message)); } }
void ThreadedWork() { _threadRunning = true; while (_threadRunning) { initState = NuitrackLoader.InitNuitrackLibraries(); NuitrackInit(); } }
void Awake() { // NuitrackLoader.InitNuitrackLibraries(); initState = NuitrackLoader.InitNuitrackLibraries(); { if (initEvent != null) { initEvent.Invoke(initState); } } Screen.sleepTimeout = SleepTimeout.NeverSleep; }
void Awake() { // NuitrackLoader.InitNuitrackLibraries(); initState = NuitrackLoader.InitNuitrackLibraries(); { if (initEvent != null) { initEvent.Invoke(initState); } } Screen.sleepTimeout = SleepTimeout.NeverSleep; Application.targetFrameRate = 60; // Debug.Log ("NuitrackStart"); #if UNITY_ANDROID && !UNITY_EDITOR if (initState == NuitrackInitState.INIT_OK) #endif NuitrackInit(); }
void Awake() { initState = NuitrackAndroidLoader.InitNuitrackLibraries(); if (initEvent != null) // Triggers for any listeners { initEvent.Invoke(initState); } Screen.sleepTimeout = SleepTimeout.NeverSleep; Application.targetFrameRate = 60; if (initState == NuitrackInitState.INIT_OK) { NuitrackInit(); nuitrack.Nuitrack.SetConfigValue("AstraProPerseeDepthProvider.RGB.Width", "1280"); nuitrack.Nuitrack.SetConfigValue("AstraProPerseeDepthProvider.RGB.Height", "720"); nuitrack.Nuitrack.SetConfigValue("AstraProPerseeDepthProvider.Depth.Width", "640"); nuitrack.Nuitrack.SetConfigValue("AstraProPerseeDepthProvider.Depth.Height", "480"); nuitrack.Nuitrack.SetConfigValue("Skeletonization.MaxDistance", "7000"); } }