コード例 #1
0
    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();
        }
    }
コード例 #2
0
    // 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);
    }
コード例 #3
0
    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));
        }
    }
コード例 #4
0
    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;
    }
コード例 #6
0
    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();
    }