protected override void Initialize()
 {
     Debug.Assert(_scanSelectorProxy != null, "ScanSelectorProxy cannot be null");
     _scanController = _scanSelectorProxy.Create();
     _scanController.ScanControllerDone.AddListener(OnScanDone);
     _scanController.StartScanning(_metaReconstruction);
 }
Esempio n. 2
0
        /// <summary>
        /// Creates an instance of <see cref="EnvironmentInitializerFactory"/> class.
        /// </summary>
        /// <param name="metaContext">The Context to acces to the required services.</param>
        /// <param name="environmentScanControllerPrefab">The scan selector prefab used to control the environment reconstruction.</param>
        internal EnvironmentInitializerFactory(IMetaContextInternal metaContext, BaseEnvironmentScanController environmentScanControllerPrefab)
        {
            if (metaContext == null)
            {
                throw new ArgumentNullException("metaContext");
            }

            _metaContext = metaContext;
            _environmentScanControllerPrefab = environmentScanControllerPrefab;
            _metaLocalization             = _metaContext.Get <MetaLocalization>();
            _environmentProfileRepository = _metaContext.Get <IEnvironmentProfileRepository>();
            _slamLocalizer = GameObject.FindObjectOfType <SlamLocalizer>();
        }
        /// <summary>
        /// Creates an instance of <see cref="NewDefaultEnvironmentWithReconstructionInitialization"/> class.
        /// </summary>
        /// <param name="slamLocalizer">Slam type localizer.</param>
        /// <param name="metaReconstruction">Object that manages the environment reconstruction.</param>
        /// <param name="scanControllerPrefab">Triggerer of the the environment reconstruction scanning process.</param>
        public ReconstructionOnlyEnvironmentInitialization(ISlamLocalizer slamLocalizer, IMetaReconstruction metaReconstruction, BaseEnvironmentScanController scanControllerPrefab)
        {
            if (scanControllerPrefab == null)
            {
                throw new ArgumentNullException("scanControllerPrefab");
            }
            if (slamLocalizer == null)
            {
                throw new ArgumentNullException("slamLocalizer");
            }
            if (metaReconstruction == null)
            {
                throw new ArgumentNullException("metaReconstruction");
            }

            _metaReconstruction   = metaReconstruction;
            _slamLocalizer        = slamLocalizer;
            _scanControllerPrefab = scanControllerPrefab;
        }
        /// <summary>
        /// Creates an instance of <see cref="DefaultEnvironmentWithReconstructionInitializationFactory"/> class.
        /// </summary>
        /// <param name="environmentProfileRepository">Repository to access to the environment profiles.</param>
        /// <param name="slamLocalizer">Slam type localizer. If null, means that other localizer was selected.</param>
        /// <param name="metaReconstruction">Object that manages the environment reconstruction.</param>
        /// <param name="scanControllerPrefab">Triggerer of the the environment reconstruction scanning process.</param>
        public DefaultEnvironmentWithReconstructionInitializationFactory(IEnvironmentProfileRepository environmentProfileRepository, ISlamLocalizer slamLocalizer, IMetaReconstruction metaReconstruction, BaseEnvironmentScanController scanControllerPrefab)
        {
            if (environmentProfileRepository == null)
            {
                throw new ArgumentNullException("environmentProfileRepository");
            }

            if (scanControllerPrefab == null)
            {
                throw new ArgumentNullException("scanControllerPrefab");
            }

            if (metaReconstruction == null)
            {
                throw new ArgumentNullException("metaReconstruction");
            }

            _environmentProfileRepository = environmentProfileRepository;
            _slamLocalizer        = slamLocalizer;
            _scanControllerPrefab = scanControllerPrefab;
            _metaReconstruction   = metaReconstruction;
        }