private void ChangeARMode(AugmentedRealityTypes nextARMode)
        {
            if (nextARMode != lastARMode)
            {
                try
                {
                    Sys.m_ARMode = nextARMode;
                    if (Sys.m_ARMode == AugmentedRealityTypes.None)
                    {
                        MainCamera.clearFlags = CameraClearFlags.Skybox;
                    }
                    else
                    {
                        MainCamera.clearFlags      = CameraClearFlags.Color;
                        MainCamera.backgroundColor = ColorExt.TransparentBlack;
                    }

                    lastARMode = Sys.m_ARMode;
                    OnARModeChange();
                }
                catch (Exception exp)
                {
                    Debug.LogError($"Could not change AR mode from {lastARMode} to {Sys.m_ARMode}. Reason: {exp.Message}");
                    Sys.m_ARMode = lastARMode;
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Combine flags for a platform into a single identifier.
 /// </summary>
 /// <param name="sys"></param>
 /// <param name="display"></param>
 /// <param name="ar"></param>
 /// <param name="opt"></param>
 /// <returns></returns>
 public static PlatformType Compose(SystemTypes sys, DisplayTypes display, AugmentedRealityTypes ar, Options opt)
 {
     return((PlatformType)(((int)sys << SYS_OFFSET)
                           | ((int)display << DISPLAY_OFFSET)
                           | ((int)ar << AR_OFFSET)
                           | (int)opt));
 }
Exemple #3
0
 private void Display_ARModeChange(object sender, AugmentedRealityTypes e)
 {
     if (e == AugmentedRealityTypes.PassthroughCamera &&
         Find.Any(out ARCoreSession arCoreSession))
     {
         arCoreSession.SessionConfig.PlaneFindingMode = DetectedPlaneFindingMode.HorizontalAndVertical;
     }
 }