public void RunWithConfig(ARKitSessionConfiguration config)
 {
     config.alignment = UnityARAlignment.UnityARAlignmentGravityAndHeading;
     #if !UNITY_EDITOR
     StartSession(m_NativeARSession, config);
     #endif
 }
 public void RunWithConfigAndOptions(ARKitSessionConfiguration config, UnityARSessionRunOption runOptions)
 {
     config.alignment = UnityARAlignment.UnityARAlignmentGravityAndHeading;
     #if !UNITY_EDITOR
     StartSessionWithOptions(m_NativeARSession, config, runOptions);
     #endif
 }
        void OnGUI()
        {
            if (GUI.Button(new Rect(100, 100, 200, 50), "Stop"))
            {
                UnityARSessionNativeInterface.GetARSessionNativeInterface().Pause();
            }
            if (GUI.Button(new Rect(300, 100, 200, 50), "Start"))
            {
                ARKitWorldTrackingSessionConfiguration sessionConfig = new ARKitWorldTrackingSessionConfiguration(alignmentOptions [currentAlignmentIndex], planeOptions[currentPlaneIndex]);
                UnityARSessionNativeInterface.GetARSessionNativeInterface().RunWithConfigAndOptions(sessionConfig, runOptions[currentOptionIndex]);
            }
            if (GUI.Button(new Rect(100, 300, 200, 100), "Start Non-WT Session"))
            {
                ARKitSessionConfiguration sessionConfig = new ARKitSessionConfiguration(alignmentOptions [currentAlignmentIndex], true, true);
                UnityARSessionNativeInterface.GetARSessionNativeInterface().RunWithConfig(sessionConfig);
            }
            string runOptionStr = (currentOptionIndex == 0 ? "Full" : (currentOptionIndex == 1 ? "Tracking" : (currentOptionIndex == 2 ? "Anchors" : "None")));

            if (GUI.Button(new Rect(100, 200, 150, 50), "RunOption:" + runOptionStr))
            {
                currentOptionIndex = (currentOptionIndex + 1) % 4;
            }
            string alignmentOptionStr = (currentAlignmentIndex == 0 ? "Camera" : (currentAlignmentIndex == 1 ? "Gravity" :  "GravityAndHeading"));

            if (GUI.Button(new Rect(300, 200, 150, 50), "AlignOption:" + alignmentOptionStr))
            {
                currentAlignmentIndex = (currentAlignmentIndex + 1) % 3;
            }
            string planeOptionStr = currentPlaneIndex == 0 ? "Horizontal" :  "None";

            if (GUI.Button(new Rect(500, 200, 150, 50), "PlaneOption:" + planeOptionStr))
            {
                currentPlaneIndex = (currentPlaneIndex + 1) % 2;
            }
        }
 private static extern void StartSessionWithOptions(IntPtr nativeSession, ARKitSessionConfiguration configuration, UnityARSessionRunOption runOptions);
 private static extern void StartSession(IntPtr nativeSession, ARKitSessionConfiguration configuration);
        public void RunWithConfig(ARKitSessionConfiguration config)
        {
#if !UNITY_EDITOR && UNITY_IOS
            StartSession(m_NativeARSession, config);
#endif
        }
        public void RunWithConfigAndOptions(ARKitSessionConfiguration config, UnityARSessionRunOption runOptions)
        {
#if !UNITY_EDITOR && UNITY_IOS
            StartSessionWithOptions(m_NativeARSession, config, runOptions);
#endif
        }
Exemple #8
0
 public void RunWithConfig(ARKitSessionConfiguration config)
 {
     StartSession(m_NativeARSession, config);
 }
Exemple #9
0
 public void RunWithConfigAndOptions(ARKitSessionConfiguration config, UnityARSessionRunOption runOptions)
 {
     StartSessionWithOptions(m_NativeARSession, config, runOptions);
 }