Ejemplo n.º 1
0
        IEnumerator Initialize()
        {
            // Make sure we've checked for availability
            if (ARSubsystemManager.systemState <= ARSystemState.CheckingAvailability)
            {
                yield return(ARSubsystemManager.CheckAvailability());
            }

            // Make sure we didn't get disabled while checking for availability
            if (!enabled)
            {
                yield break;
            }

            // Complete install if necessary
            if (((ARSubsystemManager.systemState == ARSystemState.NeedsInstall) && attemptUpdate) ||
                (ARSubsystemManager.systemState == ARSystemState.Installing))
            {
                yield return(ARSubsystemManager.Install());
            }

            // If we're still enabled and everything is ready, then start.
            if (ARSubsystemManager.systemState == ARSystemState.Ready && enabled)
            {
                ARSubsystemManager.lightEstimationRequested = lightEstimation;
                ARSubsystemManager.StartSubsystems();
            }
            else
            {
                enabled = false;
            }
        }
Ejemplo n.º 2
0
        void OnEnable()
        {
#if DEBUG
            WarnIfMultipleARSessions();
#endif
            ARSubsystemManager.CreateSubsystems();
            StartCoroutine(Initialize());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Resets the AR Session. This destroys the current session, including all trackables, and
        /// then establishes a new session.
        /// </summary>
        public void Reset()
        {
            if (ARSubsystemManager.systemState < ARSystemState.Ready)
            {
                return;
            }

            ARSubsystemManager.StopSubsystems();
            ARSubsystemManager.DestroySubsystems();
            ARSubsystemManager.CreateSubsystems();
            ARSubsystemManager.StartSubsystems();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Resets the AR Session. This destroys the current session, including all trackables, and
        /// then establishes a new session.
        /// </summary>
        public void Reset()
        {
            if (ARSubsystemManager.systemState < ARSystemState.Ready)
            {
                return;
            }

            ARSubsystemManager.StopSubsystems();
            ARSubsystemManager.DestroySubsystems();
            ARSubsystemManager.CreateSubsystems();
            ARSubsystemManager.lightEstimationRequested = lightEstimation;
            ARSubsystemManager.StartSubsystems();
        }
Ejemplo n.º 5
0
 void OnDestroy()
 {
     ARSubsystemManager.DestroySubsystems();
 }
Ejemplo n.º 6
0
 void OnDisable()
 {
     ARSubsystemManager.StopSubsystems();
 }