Пример #1
0
        //void OnApplicationQuit()
        //{
        //    Debug.Log("On ApplicationQuit");
        //    isPrcStop = true;
        //    isClosed = true;
        //    Close();
        //}


        /// <summary>
        /// Open Device and Open Streams according to the user choice
        /// </summary>
        private void IminectInitialize()
        {
            //Returns if Device is unavailable
            //Returns if Already Initialized
            if (!imiManager.IsDeviceAvailable() || iminectInitialized)
            {
                return;
            }

            ImiWrapper.ErrorCode error;
            if ((error = imiManager.OpenDevice()) != ImiWrapper.ErrorCode.OK)
            {
                Debug.LogError(error);
                return;
            }

            //Open Depth/Skeleton Stream
            error = openDepthAndSkeletonStream();

            if (error != ImiWrapper.ErrorCode.OK)
            {
                Debug.LogError(error);
                return;
            }

            //Open Color Stream
            if (imiManager.processColorData)
            {
                if ((error = ImiWrapper.OpenStream(ImiWrapper.ImiFrameType.IMI_COLOR_FRAME,
                                                   ImiWrapper.ImiImageResolution.IMI_IMAGE_RESOLUTION_640x480,
                                                   ImiWrapper.ImiPixelFormat.IMI_PIXEL_FORMAT_IMAGE_RGB24))
                    != ImiWrapper.ErrorCode.OK)
                {
                    Debug.LogError(error);
                    return;
                }
            }

            Debug.Log("Initialize success!");
            iminectInitialized = true;
        }