Exemplo n.º 1
0
 private void LockDectingPlane(string command)
 {
     if (command == "lock")
     {
         UnityARSessionNativeInterface          m_session      = UnityARSessionNativeInterface.GetARSessionNativeInterface();
         UnityARPlaneDetection                  planeDetection = UnityARPlaneDetection.None;
         ARKitWorldTrackingSessionConfiguration config         = new ARKitWorldTrackingSessionConfiguration();
         config.planeDetection        = planeDetection;
         config.alignment             = UnityARAlignment.UnityARAlignmentGravity;
         config.getPointCloudData     = false;
         config.enableLightEstimation = false;
         m_session.RunWithConfig(config);
     }
 }
Exemplo n.º 2
0
        void InitializeARKit(MessageEventArgs mea)
        {
            Debug.Log("init ARKit");
                        #if !UNITY_EDITOR
            Application.targetFrameRate = 60;
            m_session = UnityARSessionNativeInterface.GetARSessionNativeInterface();
            ARKitWorldTackingSessionConfiguration config = new ARKitWorldTackingSessionConfiguration();
            config.planeDetection        = UnityARPlaneDetection.Horizontal;
            config.alignment             = UnityARAlignment.UnityARAlignmentGravity;
            config.getPointCloudData     = true;
            config.enableLightEstimation = true;
            m_session.RunWithConfig(config);

            UnityARSessionNativeInterface.ARFrameUpdatedEvent  += ARFrameUpdated;
            UnityARSessionNativeInterface.ARAnchorAddedEvent   += ARAnchorAdded;
            UnityARSessionNativeInterface.ARAnchorUpdatedEvent += ARAnchorUpdated;
            UnityARSessionNativeInterface.ARAnchorRemovedEvent += ARAnchorRemoved;
                        #endif
        }