示例#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;
            }
        }
示例#2
0
        void OnEnable()
        {
#if DEBUG
            WarnIfMultipleARSessions();
#endif
            ARSubsystemManager.CreateSubsystems();
            StartCoroutine(Initialize());
        }
示例#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();
        }
示例#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();
        }
示例#5
0
 void OnDestroy()
 {
     ARSubsystemManager.DestroySubsystems();
 }
示例#6
0
 void OnDisable()
 {
     ARSubsystemManager.StopSubsystems();
 }