Esempio n. 1
0
 void OnDestroy()
 {
     if (IsInited)
     {
         m_OrbbecCallback = null;
         m_Wrapper.ShutDown();
         IsInited = false;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Destroy the Manager instance, use for close the device.
 /// 销毁此管理类单件 用于关闭设备
 /// </summary>
 public void DoDestroy()
 {
     m_OrbbecCallback = null;
     if (IsInited)
     {
         m_Wrapper.ShutDown();
         IsInited = false;
     }
     GameObject.Destroy(gameObject);
     ms_Instance = null;
 }
Esempio n. 3
0
        void WaitForDevice()
        {
            if (!IsDeviceReady)
            {
                return;
            }

            m_Wrapper.InitResource();
            m_OrbbecCallback = UpdateData;
            IsInited         = true;

            if (m_Param != null)
            {
                if (m_Param.OrbbecInitResourceCallBack != null)
                {
                    m_Param.OrbbecInitResourceCallBack();
                }
            }
        }
Esempio n. 4
0
        protected void Init()
        {
            if (null == m_Param)
            {
                m_Param = new OrbbecManagerParam();
            }

            if (m_Param.IsTrackingSkeleton)
            {
                m_Param.IsUseUserGenerator = true;
            }

            if (m_Param.IsUseUVC)
            {
                m_Param.IsUseUserImage = false;
            }

            m_Wrapper.Init(m_Param);

            if (m_Param.IsUseHandsTracker)
            {
                m_Wrapper.OnHandsUpdate = OnHandsUpdate;
            }

            if (ms_Instance.m_Param.IsNeverSleep)
            {
                Screen.sleepTimeout = SleepTimeout.NeverSleep;
            }

            if (m_Param.IsTrackingSkeleton)
            {
                m_Wrapper.UserEnterCallBack  += OnUserEnter;
                m_Wrapper.UserLeaveCallBack  += OnUserLeave;
                m_Wrapper.UserUpdateCallBack += OnUserUpdate;
            }

            m_OrbbecCallback = WaitForDevice;
        }