public void Initialize(IARModeUIController resolver) { m_ARModeUIController = (ARModeUIController)resolver; m_Raycaster = RaycasterRef.Resolve(m_ARModeUIController); DisposeSelectors(); m_FirstSelectedPlaneGetter = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.firstSelectedPlane)); m_SecondSelectedPlaneGetter = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.secondSelectedPlane)); m_PlacementRuleGameObjectGetter = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, nameof(IARPlacementDataProvider.placementRulesGameObject)); m_ObjectSelectionInfoGetter = UISelectorFactory.createSelector <SelectObjectAction.IObjectSelectionInfo>(ProjectContext.current, nameof(IObjectSelectorDataProvider.objectSelectionInfo)); m_States = new Dictionary <ViewBasedInstructionUI, SetARInstructionUIAction.InstructionUIStep> { { ViewBasedInstructionUI.Init, new SetARInstructionUIAction.InstructionUIStep { stepIndex = (int)ViewBasedInstructionUI.Init, onNext = StartInstruction } }, { ViewBasedInstructionUI.AlignModelView, new SetARInstructionUIAction.InstructionUIStep { stepIndex = (int)ViewBasedInstructionUI.AlignModelView, onNext = AlignModelViewNext, onBack = AlignModelViewBack } }, { ViewBasedInstructionUI.FindTheFloor, new SetARInstructionUIAction.InstructionUIStep { stepIndex = (int)ViewBasedInstructionUI.FindTheFloor, onNext = FindTheFloorNext, onBack = FindTheFloorBack } }, { ViewBasedInstructionUI.ConfirmPlacement, new SetARInstructionUIAction.InstructionUIStep { stepIndex = (int)ViewBasedInstructionUI.ConfirmPlacement, onNext = ConfirmPlacementNext, onBack = ConfirmPlacementBack } }, { ViewBasedInstructionUI.OnBoardingComplete, new SetARInstructionUIAction.InstructionUIStep { stepIndex = (int)ViewBasedInstructionUI.OnBoardingComplete, onNext = OnBoardingCompleteNext } }, }; Dispatcher.Dispatch(SelectObjectAction.From(new ObjectSelectionInfo())); }
public void Initialize(IARModeUIController resolver) { DisposeSelectors(); m_ARModeUIController = (ARModeUIController)resolver; m_MarkerController = m_MarkerControllerResolverRef.Resolve(m_ARModeUIController).MarkerController; m_PlacementStateDataSelector = UISelectorFactory.createSelector <ARPlacementStateData>(ARContext.current, "placementStateData"); m_PlacementRuleGameObjectSelector = UISelectorFactory.createSelector <GameObject>(ARPlacementContext.current, "placementRulesGameObject"); m_ProgressStateActionSelector = UISelectorFactory.createSelector <SetProgressStateAction.ProgressState>(ProgressContext.current, nameof(IProgressDataProvider.progressState)); m_States = new Dictionary <MarkerBasedInstructionUIState, SetARInstructionUIAction.InstructionUIStep> { { MarkerBasedInstructionUIState.Init, new SetARInstructionUIAction.InstructionUIStep() { stepIndex = (int)MarkerBasedInstructionUIState.Init, onNext = StartInstruction } }, { MarkerBasedInstructionUIState.Selection, new SetARInstructionUIAction.InstructionUIStep() { stepIndex = (int)MarkerBasedInstructionUIState.Selection, onNext = SelectionNext, onBack = SelectionBack } }, { MarkerBasedInstructionUIState.Anchoring, new SetARInstructionUIAction.InstructionUIStep() { stepIndex = (int)MarkerBasedInstructionUIState.Anchoring, onNext = AnchoringNext, onBack = AnchoringBack } }, //{ MarkerBasedInstructionUIState.Alignment, new SetARInstructionUIAction.InstructionUIStep(){stepIndex = (int)MarkerBasedInstructionUIState.Alignment, onNext = AlignmentNext, onBack = AlignmentBack}}, { MarkerBasedInstructionUIState.OnBoardingComplete, new SetARInstructionUIAction.InstructionUIStep() { stepIndex = (int)MarkerBasedInstructionUIState.OnBoardingComplete, onNext = OnBoardingComplete } } }; }
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(); }
public void Initialize(ARModeUIController resolver) { m_ARModeUIController = resolver; m_Raycaster = RaycasterRef.Resolve(resolver); m_States = new Dictionary <TableTopInstructionUI, InstructionUIStep> { { TableTopInstructionUI.Init, new InstructionUIStep { stepIndex = (int)TableTopInstructionUI.Init, onNext = StartInstruction } }, { TableTopInstructionUI.FindTheFloor, new InstructionUIStep { stepIndex = (int)TableTopInstructionUI.FindTheFloor, onNext = FindTheFloorNext, onBack = FindTheFloorBack } }, { TableTopInstructionUI.ConfirmPlacement, new InstructionUIStep { stepIndex = (int)TableTopInstructionUI.ConfirmPlacement, onNext = ConfirmPlacementNext, onBack = ConfirmPlacementBack } }, { TableTopInstructionUI.OnBoardingComplete, new InstructionUIStep { stepIndex = (int)TableTopInstructionUI.OnBoardingComplete, onNext = OnBoardingCompleteNext } }, }; }
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())); }