public void Initialize(ARModeUIController resolver)
        {
            m_ARModeUIController = resolver;
            m_Raycaster          = RaycasterRef.Resolve(resolver);

            m_States = new Dictionary <WallBasedInstructionUI, InstructionUIStep>
            {
                { WallBasedInstructionUI.Init, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.Init, onNext = StartInstruction
                  } },
                { WallBasedInstructionUI.AlignModelView, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.AlignModelView, onNext = AlignModelView, onBack = AlignModelViewBack
                  } },
                { WallBasedInstructionUI.FindModelFloor, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindModelFloor, onNext = FindModelFloor, onBack = FindModelFloorBack
                  } },
                { WallBasedInstructionUI.FindFirstWall, new InstructionUIStep {
                      stepIndex   = (int)WallBasedInstructionUI.FindFirstWall, onNext = FindFirstWallNext, onBack = FindFirstWallBack,
                      validations = new IPlacementValidation[] { new WallSizeValidation(1.0f) }
                  } },
                { WallBasedInstructionUI.FindSecondWall, new InstructionUIStep {
                      stepIndex   = (int)WallBasedInstructionUI.FindSecondWall, onNext = FindSecondWallNext, onBack = FindSecondWallBack,
                      validations = new IPlacementValidation[] { new WallSizeValidation(1.0f), new ParallelWallValidation(0.3f) }
                  } },
                { WallBasedInstructionUI.ConfirmAnchorPoint, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.ConfirmAnchorPoint, onNext = ConfirmAnchorPointNext, onBack = ConfirmAnchorPointBack
                  } },
                { WallBasedInstructionUI.FindTheFloor, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindTheFloor, onNext = FindTheARFloorNext, onBack = FindTheARFloorBack
                  } },
                { WallBasedInstructionUI.FindFirstARWall, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindFirstARWall, onNext = FindFirstARWallNext, onBack = FindFirstARWallBack
                  } },
                { WallBasedInstructionUI.FindSecondARWall, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindSecondARWall, onNext = FindSecondARWallNext, onBack = FindSecondARWallBack
                  } },
                { WallBasedInstructionUI.ConfirmARAnchorPoint, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.ConfirmARAnchorPoint, onNext = ConfirmARAnchorPointNext, onBack = ConfirmARAnchorPointBack
                  } },
                // TODO: Bring step back once we have adjustments enabled
                //{ WallBasedInstructionUI.ConfirmPlacement, new InstructionUIStep{ stepIndex = (int)WallBasedInstructionUI.ConfirmPlacement, onNext = ConfirmPlacementNext, onBack = ConfirmPlacementBack } },
                { WallBasedInstructionUI.OnBoardingComplete, new InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.OnBoardingComplete, onNext = OnBoardingCompleteNext
                  } },
            };
            m_PlaneSelector = new SpatialOrientedPlaneSelector();
        }
示例#2
0
        public void Initialize(IARModeUIController resolver)
        {
            DisposeResources();
            m_ARModeUIController              = (ARModeUIController)resolver;
            m_Raycaster                       = RaycasterRef.Resolve(m_ARModeUIController);
            m_FirstSelectedPlaneSelector      = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.firstSelectedPlane));
            m_SecondSelectedPlaneSelector     = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.secondSelectedPlane));
            m_BoundinBoxRootSelector          = UISelectorFactory.createSelector <Transform>(ARPlacementContext.current, nameof(IARPlacementDataProvider.boundingBoxRootNode));
            m_ModelFloorSelector              = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.modelFloor));
            m_ARFloorSelector                 = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.arFloor));
            m_FirstARSelectedPlaneSelector    = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.firstARSelectedPlane));
            m_SecondARSelectedPlaneSelector   = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.secondARSelectedPlane));
            m_ModelPlacementLocationSelector  = UISelectorFactory.createSelector <Vector3>(ARPlacementContext.current, nameof(IARPlacementDataProvider.modelPlacementLocation));
            m_ARPlacementLocationSelector     = UISelectorFactory.createSelector <Vector3>(ARPlacementContext.current, nameof(IARPlacementDataProvider.arPlacementLocation));
            m_ARPlacementAlignmentSelector    = UISelectorFactory.createSelector <Vector3>(ARPlacementContext.current, nameof(IARPlacementDataProvider.arPlacementAlignment));
            m_RootSelector                    = UISelectorFactory.createSelector <Transform>(PipelineContext.current, nameof(IPipelineDataProvider.rootNode));
            m_PlacementRuleGameObjectSelector = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.placementRulesGameObject));
            m_ObjectSelectionInfoSelector     = UISelectorFactory.createSelector <SelectObjectAction.IObjectSelectionInfo>(ProjectContext.current, nameof(IObjectSelectorDataProvider.objectSelectionInfo));

            m_States = new Dictionary <WallBasedInstructionUI, SetARInstructionUIAction.InstructionUIStep>
            {
                { WallBasedInstructionUI.Init, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.Init, onNext = StartInstruction
                  } },
                { WallBasedInstructionUI.AlignModelView, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.AlignModelView, onNext = AlignModelView, onBack = AlignModelViewBack
                  } },
                { WallBasedInstructionUI.FindModelFloor, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindModelFloor, onNext = FindModelFloor, onBack = FindModelFloorBack
                  } },
                {
                    WallBasedInstructionUI.FindFirstWall, new SetARInstructionUIAction.InstructionUIStep
                    {
                        stepIndex   = (int)WallBasedInstructionUI.FindFirstWall, onNext = FindFirstWallNext, onBack = FindFirstWallBack,
                        validations = new IPlacementValidation[] { new WallSizeValidation(1.0f) }
                    }
                },
                {
                    WallBasedInstructionUI.FindSecondWall, new SetARInstructionUIAction.InstructionUIStep
                    {
                        stepIndex   = (int)WallBasedInstructionUI.FindSecondWall, onNext = FindSecondWallNext, onBack = FindSecondWallBack,
                        validations = new IPlacementValidation[] { new WallSizeValidation(1.0f), new ParallelWallValidation(0.3f) }
                    }
                },
                { WallBasedInstructionUI.ConfirmAnchorPoint, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.ConfirmAnchorPoint, onNext = ConfirmAnchorPointNext, onBack = ConfirmAnchorPointBack
                  } },
                { WallBasedInstructionUI.FindTheFloor, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindTheFloor, onNext = FindTheARFloorNext, onBack = FindTheARFloorBack
                  } },
                { WallBasedInstructionUI.FindFirstARWall, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindFirstARWall, onNext = FindFirstARWallNext, onBack = FindFirstARWallBack
                  } },
                { WallBasedInstructionUI.FindSecondARWall, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.FindSecondARWall, onNext = FindSecondARWallNext, onBack = FindSecondARWallBack
                  } },
                { WallBasedInstructionUI.ConfirmARAnchorPoint, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.ConfirmARAnchorPoint, onNext = ConfirmARAnchorPointNext, onBack = ConfirmARAnchorPointBack
                  } },

                // TODO: Bring step back once we have adjustments enabled
                //{ WallBasedInstructionUI.ConfirmPlacement, new InstructionUIStep{ stepIndex = (int)WallBasedInstructionUI.ConfirmPlacement, onNext = ConfirmPlacementNext, onBack = ConfirmPlacementBack } },
                { WallBasedInstructionUI.OnBoardingComplete, new SetARInstructionUIAction.InstructionUIStep {
                      stepIndex = (int)WallBasedInstructionUI.OnBoardingComplete, onNext = OnBoardingCompleteNext
                  } },
            };
            m_PlaneSelector          = new SpatialOrientedPlaneSelector();
            m_ARAxisTrackingSelector = UISelectorFactory.createSelector <bool>(DebugOptionContext.current, nameof(IDebugOptionDataProvider.ARAxisTrackingEnabled));
            Dispatcher.Dispatch(SelectObjectAction.From(new ObjectSelectionInfo()));
        }